Merge lp:~d-jj/cloud-init/chef-12-updates into lp:~cloud-init-dev/cloud-init/trunk

Proposed by JJ Asghar
Status: Rejected
Rejected by: Scott Moser
Proposed branch: lp:~d-jj/cloud-init/chef-12-updates
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 178 lines (+81/-42)
2 files modified
doc/examples/cloud-config-chef.txt (+77/-41)
templates/chef_client.rb.tmpl (+4/-1)
To merge this branch: bzr merge lp:~d-jj/cloud-init/chef-12-updates
Reviewer Review Type Date Requested Status
JJ Asghar (community) Approve
Review via email: mp+262266@code.launchpad.net

Description of the change

This is to update the Chef examples and changes for the newer/est ways
Chef is converting to. Omnibus is now the default installation method, but
there are also more up-to-date package repos at packagecloud.io if the user
still wants to install the deb package.

I have also added the encrypted_data_bag option to the client.rb being that
it is a useful option to have for more secure environments.

To post a comment you must log in.
JJ Asghar (d-jj) :
review: Approve
JJ Asghar (d-jj) wrote :

I have signed the Canonical Contributors license, and been approved. Is there anything else i need to get this merged?

Scott Moser (smoser) wrote :

Hi JJ,
 Sorry for the very slow reply.

 Almost all nit picks inline below.

Thanks for your suggestion,
If you have further questions, please join #cloud-init on Freenode and poke me (smoser).

Scott Moser (smoser) wrote :

Hello,
Thank you for taking the time to contribute to cloud-init. Cloud-init has moved its revision control system to git. As a result, we are marking all bzr merge proposals as 'rejected'. If you would like to re-submit this proposal for review, please do so by following the current HACKING documentation at http://cloudinit.readthedocs.io/en/latest/topics/hacking.html .

I believe portions of this might be upstream at this point, see commits
 https://git.launchpad.net/cloud-init/commit/?id=482b2746b5919233
 https://git.launchpad.net/cloud-init/commit/?id=291d2976bd7b

JJ Asghar (d-jj) wrote :

Unmerged revisions

1075. By JJ Asghar on 2015-03-03

i hate whitespace issues

1074. By JJ Asghar on 2015-03-03

WS removal

1073. By JJ Asghar on 2015-03-03

fixed up per Matt Rays suggestions and catches

1072. By JJ Asghar on 2015-03-03

updated for chef 12 and packagecloud.io changes and also converted to omnibus as the defacto standard to install chef

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/examples/cloud-config-chef.txt'
2--- doc/examples/cloud-config-chef.txt 2012-12-12 15:39:43 +0000
3+++ doc/examples/cloud-config-chef.txt 2015-06-17 19:47:46 +0000
4@@ -1,61 +1,97 @@
5 #cloud-config
6 #
7-# This is an example file to automatically install chef-client and run a
8+# This is an example file to automatically install chef-client and run a
9 # list of recipes when the instance boots for the first time.
10 # Make sure that this file is valid yaml before starting instances.
11 # It should be passed as user-data when starting the instance.
12 #
13 # This example assumes the instance is 12.04 (precise)
14
15-
16-# The default is to install from packages.
17-
18-# Key from http://apt.opscode.com/packages@opscode.com.gpg.key
19+# The default is to install from omnibus.
20+
21+# Key from https://packagecloud.io/gpg.key
22 apt_sources:
23- - source: "deb http://apt.opscode.com/ $RELEASE-0.10 main"
24+ - source: "deb https://packagecloud.io/chef/stable/ubuntu/ precise main"
25 key: |
26- -----BEGIN PGP PUBLIC KEY BLOCK-----
27- Version: GnuPG v1.4.9 (GNU/Linux)
28-
29- mQGiBEppC7QRBADfsOkZU6KZK+YmKw4wev5mjKJEkVGlus+NxW8wItX5sGa6kdUu
30- twAyj7Yr92rF+ICFEP3gGU6+lGo0Nve7KxkN/1W7/m3G4zuk+ccIKmjp8KS3qn99
31- dxy64vcji9jIllVa+XXOGIp0G8GEaj7mbkixL/bMeGfdMlv8Gf2XPpp9vwCgn/GC
32- JKacfnw7MpLKUHOYSlb//JsEAJqao3ViNfav83jJKEkD8cf59Y8xKia5OpZqTK5W
33- ShVnNWS3U5IVQk10ZDH97Qn/YrK387H4CyhLE9mxPXs/ul18ioiaars/q2MEKU2I
34- XKfV21eMLO9LYd6Ny/Kqj8o5WQK2J6+NAhSwvthZcIEphcFignIuobP+B5wNFQpe
35- DbKfA/0WvN2OwFeWRcmmd3Hz7nHTpcnSF+4QX6yHRF/5BgxkG6IqBIACQbzPn6Hm
36- sMtm/SVf11izmDqSsQptCrOZILfLX/mE+YO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Re8cAw/+9Vp0oDtOvBWAXycnCbdQeHvwh2+Uj
104+ 2u2f7K3CDMoevcBl4L5fkFkYTkmixCDy5nst1VM5nINueUIkUAJJbOGpd6yFdif7
105+ mQR0JWcPLudb+fwusJ4UEACYWhPa8Gxa7eYopRsydlcdEzwpmo6E+V8GIdLFRFFp
106+ KHQEzbSW5coxzU6oOiPbTurCZorIMHTA9cpAZoMUGKaSt19UKIMvSqtcDayhgf4c
107+ Z2ay1z0fdJ2PuLeNnWeiGyfq78q6wqSaJq/h6JdAiwXplFd3gqJZTrFZz7A6Q6Pd
108+ 7B+9PZ/DUdEO3JeZlHJDfRmfU2XPoyPUoq79+whP5Tl3WwHUv7Fg357kRSdzKv9D
109+ bgmhqRHlgVeKn9pwN4cpVBN+idzwPefQksSKH4lBDvVr/9j+V9mmrOx7QmQ5LCc/
110+ 1on+L0dqo6suoajADhKy+lDQbzs2mVb4CLpPKncDup/9iJbjiR17DDFMwgyCoy5O
111+ HJICQ5lckNNgkHTS6Xiogkt28YfK4P3S0GaZgIrhKQ7AmO3O+hB12Zr+olpeyhGB
112+ OpBD80URntdEcenvfnXBY/BsuAVbTGXiBzrlBEyQxg656jUeqAdXg+nzCvP0yJlB
113+ UOjEcwyhK/U2nw9nGyaR3u0a9r24LgijGpdGabIeJm6O9vuuqFHHGI72pWUEs355
114+ lt8q1pAoJUv8NehQmlaR0h5wcwhEtwM6fiSIUTnuJnyHT053GjsUD7ef5fY1KEFm
115+ aZeW04kRtFDOPinz0faE8hvsxzsVgkKye1c2vkXKdOXvA3x+pZzlTHtcgMOhjKQA
116+ sA==
117+ =H60S
118 -----END PGP PUBLIC KEY BLOCK-----
119
120 chef:
121
122- # Valid values are 'gems' and 'packages' and 'omnibus'
123- install_type: "packages"
124+ # Valid values are 'gems' and 'packages' and 'omnibus'.
125+ # Omnibus has become the defacto way to describute chef
126+ # binaries, if you need the deb, use the packagecloud.io
127+ # above.
128+ install_type: "omnibus"
129
130 # Boolean: run 'install_type' code even if chef-client
131 # appears already installed.
132 force_install: false
133
134 # Chef settings
135- server_url: "https://chef.yourorg.com:4000"
136+ server_url: "https://chef.yourorg.com/organizations/myorg/"
137
138 # Node Name
139 # Defaults to the instance-id if not present
140@@ -71,8 +107,8 @@
141 -----BEGIN RSA PRIVATE KEY-----
142 YOUR-ORGS-VALIDATION-KEY-HERE
143 -----END RSA PRIVATE KEY-----
144-
145- # A run list for a first boot json
146+
147+# A run list for a first boot json
148 run_list:
149 - "recipe[apache2]"
150 - "role[db]"
151@@ -85,7 +121,7 @@
152 keepalive: "off"
153
154 # if install_type is 'omnibus', change the url to download
155- omnibus_url: "https://www.opscode.com/chef/install.sh"
156+ omnibus_url: "https://chef.io/chef/install.sh"
157
158
159 # Capture all subprocess output into a logfile
160
161=== modified file 'templates/chef_client.rb.tmpl'
162--- templates/chef_client.rb.tmpl 2014-10-11 23:59:50 +0000
163+++ templates/chef_client.rb.tmpl 2015-06-17 19:47:46 +0000
164@@ -1,6 +1,6 @@
165 ## template:jinja
166 {#
167-This file is only utilized if the module 'cc_chef' is enabled in
168+This file is only utilized if the module 'cc_chef' is enabled in
169 cloud-config. Specifically, in order to enable it
170 you need to add the following to config:
171 chef:
172@@ -56,3 +56,6 @@
173 {% if show_time %}
174 Chef::Log::Formatter.show_time = true
175 {% endif %}
176+{% if encrypted_data_bag_secret %}
177+encrypted_data_bag_secret "{{encrypted_data_bag_secret}}"
178+{% endif %}