chef-boneyard / chef-provisioning-aws

AWS driver and resources for Chef that uses the AWS SDK
Apache License 2.0
142 stars 121 forks source link

machine_options[:convergence_options] ignored on machine resource #534

Open BGmot opened 7 years ago

BGmot commented 7 years ago
require 'chef/provisioning/aws_driver'
with_driver 'aws'
with_machine_options(
  {
    bootstrap_options: {
      associate_public_ip_address: false,
      key_name: '<snip>',
      security_group_ids: ["<snip>","<snip>"],
      subnet_id: '<snip>'
    },
    convergence_options: {
      chef_version: '12.19.36',
      chef_config: "log_level :debug\nlog_location '/var/log/chef-client.log'\n"
    }
  }
)
machine 'ey-test' do
  action  :converge
  run_list ['recipe[<snip>]']
end

Results in the latest chef-client being run at the target VM (not specified 12.19.36) and default client.rb file:

chef_server_url "http://localhost:7799"
node_name "ey-test"
client_key "/etc/chef/client.pem"
ssl_verify_mode :verify_none

My versions

$ chef --version
Chef Development Kit Version: 1.3.43
chef-client version: 12.19.36
delivery version: master (dd319aa632c2f550c92a2172b9d1226478fea997)
berks version: 5.6.4
kitchen version: 1.16.0
$ gem list provisioning

*** LOCAL GEMS ***

chef-provisioning (2.2.1)
chef-provisioning-aws (2.2.0)
stanislav-zaprudskiy commented 7 years ago

See chef/chef-provisioning#580

BGmot commented 7 years ago

@stanislav-zaprudskiy it's good that you solved your problem but sorry your chef-dk (and chef-provisioning) is way too outdated. Anyway I tried your solution, it did not help. In my case I don't see problems with machine_options, it's just convergence_options that gets ignored.

stanislav-zaprudskiy commented 7 years ago

hey @BGmot, I see the fix turned out to be applicable - 👍.

BTW, we run

chef-provisioning (2.3.2)
chef-provisioning-aws (2.2.0)
BGmot commented 7 years ago

Hi @stanislav-zaprudskiy , sorry I got your versions from that issue 580. Thanks for confirmation that the fix works for you.

jgoulah commented 7 years ago

believe this is fixed in chef-provisioning-aws 2.2.2