← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~schuio/cloud-init/chef-client-opts into lp:cloud-init

 

schu has proposed merging lp:~schuio/cloud-init/chef-client-opts into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~schuio/cloud-init/chef-client-opts/+merge/208358
-- 
https://code.launchpad.net/~schuio/cloud-init/chef-client-opts/+merge/208358
Your team cloud init development team is requested to review the proposed merge of lp:~schuio/cloud-init/chef-client-opts into lp:cloud-init.
=== modified file 'cloudinit/config/cc_chef.py'
--- cloudinit/config/cc_chef.py	2014-01-27 22:34:35 +0000
+++ cloudinit/config/cc_chef.py	2014-02-26 13:03:08 +0000
@@ -93,6 +93,8 @@
                                                'packages')
         if install_type == "gems":
             # this will install and run the chef-client from gems
+            chef_opts = util.get_cfg_option_list(chef_cfg, 'opts',
+                                                 ['-i', '1800', '-s', '20'])
             chef_version = util.get_cfg_option_str(chef_cfg, 'version', None)
             ruby_version = util.get_cfg_option_str(chef_cfg, 'ruby_version',
                                                    RUBY_VERSION_DEFAULT)
@@ -100,7 +102,7 @@
             # and finally, run chef-client
             log.debug('Running chef-client')
             util.subp(['/usr/bin/chef-client',
-                       '-d', '-i', '1800', '-s', '20'], capture=False)
+                       '-d'] + chef_opts, capture=False)
         elif install_type == 'packages':
             # this will install and run the chef-client from packages
             cloud.distro.install_packages(('chef',))

=== modified file 'doc/examples/cloud-config-chef.txt'
--- doc/examples/cloud-config-chef.txt	2012-12-12 15:39:43 +0000
+++ doc/examples/cloud-config-chef.txt	2014-02-26 13:03:08 +0000
@@ -50,6 +50,10 @@
  # Valid values are 'gems' and 'packages' and 'omnibus'
  install_type: "packages"
 
+ # chef-client options
+ # Note: '-d' (daemonize) is always set
+ opts: "-i 1800 -s 20"
+
  # Boolean: run 'install_type' code even if chef-client
  #          appears already installed.
  force_install: false


Follow ups