chef-boneyard / chef-provisioning

A library for creating machines and infrastructures idempotently in Chef.
Apache License 2.0
524 stars 164 forks source link

setting up chef_version doesn't seems to be working #580

Open munusamymp opened 7 years ago

munusamymp commented 7 years ago

I am trying to force my chef-client version to be < 13.

I tried adding it to the with_machine_options() but it doesn't seems to be working.

with_machine_options({
  convergence_options: {
    chef_version: "12.19.36"
 },
  transport_address_location: :private_ip,
  aws_tags: { 'UAI' => 'xxxxxxxx' },
  ssh_username: ubuntu,
  bootstrap_options: {
    block_device_mappings: [
  ....
  ....
  ....

Machines provisions perfectly fine but it still installs the latest version of chef-client.

Here is my versions of chefdk and chef-client.

Chef Development Kit Version: 0.15.15
chef-client version: 12.11.18
delivery version: 0.0.23 (bf89a6b776b55b89a46bbd57fcaa615c143a09a0)
berks version: 4.3.5
kitchen version: 1.10.0

and

provisioner gem versions::

chef-provisioning-aws (1.10.0, 1.9.0)
stanislav-zaprudskiy commented 7 years ago

What fails for install_sh, is https://github.com/chef/chef-provisioning/blob/cd6f582f0e2cbe63e4dc6f2b25cbc1b3c24744b2/lib/chef/provisioning/convergence_strategy/install_sh.rb#L12-L15.

chef-provisioning-aws passes version specification properly inside Cheffish::MergedConfig object, where it is then processed by initialize method, but improperly. Supposedly, due to chef/cheffish@846079b62144d42d607bc2236ce9690f6385fbc9.

I can't judge if that is Cheffish::MergedConfig or Chef::Mash which does things wrong, but in case of our internal cloud driver which inherits from chef-provisioning-aws we were able to work around the issue by converting convergence_options to_hash (here) before passing it to Chef::Provisioning::ConvergenceStrategy.

Another workaround might be to downgrade cheffish to some older version.

robertomoutinho commented 7 years ago

Same issue here... using chef-provisioning and chef-provisionin-aws is becoming a nightmare.