Merge ~smoser/cloud-init:feature/tpl-cloud-cfg into cloud-init:master
- Git
- lp:~smoser/cloud-init
- feature/tpl-cloud-cfg
- Merge into master
Status: | Merged |
---|---|
Merged at revision: | 41d46bfb85929c79dabcec3cf21c8d71401fd2b8 |
Proposed branch: | ~smoser/cloud-init:feature/tpl-cloud-cfg |
Merge into: | cloud-init:master |
Diff against target: |
753 lines (+379/-157) 7 files modified
MANIFEST.in (+10/-1) Makefile (+3/-0) cloudinit/util.py (+28/-1) config/cloud.cfg.tmpl (+194/-0) dev/null (+0/-88) setup.py (+101/-67) tools/render-cloudcfg (+43/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Ryan Harper | Approve | ||
Review via email: mp+325192@code.launchpad.net |
Commit message
Make config/cloud.cfg a template and setup.py fixes
Currently there is no real way to have a single 'cloud.cfg' file that
works everywhere. Certain modules are routinely being not applied by
various downstream distributors. Other differences include default user.
This changes cloud.cfg to be a template that we can render per-distro
versions as needed. This makes it easier to identify common themes and
differences and resolve those.
Additionally, we add some fixes to setup.py.
- sdist now collects all the files.
- install can now be done into a virtual env, and all the data files
to with it.
We have also included some config changes that were found in the
redhat distro spec.
* include some config changes from the redhat distro spec.
Description of the change
Server Team CI bot (server-team-bot) wrote : | # |
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:d1d93cc523c
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:fc986d5fbfd
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:9ed06a64cd7
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:139aa7bdcce
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:dc47c6d0a5d
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:cce63478399
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:9e6ff73cdb6
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:ebfb84991b2
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:cfe67100c17
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:c082cb70229
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:fa22e178294
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:15f8e174fb9
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Ryan Harper (raharper) wrote : | # |
After many retries, both cent6 and cent7 packages install and run.
https:/
Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:9f28ea05e8b
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Ryan Harper (raharper) : | # |
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:cddb12952b2
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:2f3a5989c7b
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:bda19c91836
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:f02784484a8
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Ryan Harper (raharper) : | # |
Ryan Harper (raharper) wrote : | # |
Couple of nits, otherwise looks fine.
Scott Moser (smoser) wrote : | # |
addressed all.
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:d74c0b261ec
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Ryan Harper (raharper) wrote : | # |
missed one (see inline), fix and I approve
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:ec511f15dfc
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | diff --git a/MANIFEST.in b/MANIFEST.in | |||
2 | index 9426464..1a4d771 100644 | |||
3 | --- a/MANIFEST.in | |||
4 | +++ b/MANIFEST.in | |||
5 | @@ -1,6 +1,15 @@ | |||
7 | 1 | include *.py MANIFEST.in ChangeLog | 1 | include *.py MANIFEST.in LICENSE* ChangeLog |
8 | 2 | global-include *.txt *.rst *.ini *.in *.conf *.cfg *.sh | 2 | global-include *.txt *.rst *.ini *.in *.conf *.cfg *.sh |
9 | 3 | graft config | ||
10 | 4 | graft doc | ||
11 | 5 | graft packages | ||
12 | 6 | graft systemd | ||
13 | 7 | graft sysvinit | ||
14 | 8 | graft templates | ||
15 | 9 | graft tests | ||
16 | 3 | graft tools | 10 | graft tools |
17 | 11 | graft udev | ||
18 | 12 | graft upstart | ||
19 | 4 | prune build | 13 | prune build |
20 | 5 | prune dist | 14 | prune dist |
21 | 6 | prune .tox | 15 | prune .tox |
22 | diff --git a/Makefile b/Makefile | |||
23 | index 66d1dca..a3bfaf7 100644 | |||
24 | --- a/Makefile | |||
25 | +++ b/Makefile | |||
26 | @@ -69,6 +69,9 @@ check_version: | |||
27 | 69 | "not equal to code version '$(CODE_VERSION)'"; exit 2; \ | 69 | "not equal to code version '$(CODE_VERSION)'"; exit 2; \ |
28 | 70 | else true; fi | 70 | else true; fi |
29 | 71 | 71 | ||
30 | 72 | config/cloud.cfg: | ||
31 | 73 | $(PYVER) ./tools/render-cloudcfg config/cloud.cfg.tmpl config/cloud.cfg | ||
32 | 74 | |||
33 | 72 | clean_pyc: | 75 | clean_pyc: |
34 | 73 | @find . -type f -name "*.pyc" -delete | 76 | @find . -type f -name "*.pyc" -delete |
35 | 74 | 77 | ||
36 | diff --git a/cloudinit/util.py b/cloudinit/util.py | |||
37 | index 135e460..b8c3e4e 100644 | |||
38 | --- a/cloudinit/util.py | |||
39 | +++ b/cloudinit/util.py | |||
40 | @@ -592,13 +592,40 @@ def get_cfg_option_int(yobj, key, default=0): | |||
41 | 592 | 592 | ||
42 | 593 | 593 | ||
43 | 594 | def system_info(): | 594 | def system_info(): |
45 | 595 | return { | 595 | info = { |
46 | 596 | 'platform': platform.platform(), | 596 | 'platform': platform.platform(), |
47 | 597 | 'release': platform.release(), | 597 | 'release': platform.release(), |
48 | 598 | 'python': platform.python_version(), | 598 | 'python': platform.python_version(), |
49 | 599 | 'uname': platform.uname(), | 599 | 'uname': platform.uname(), |
50 | 600 | 'dist': platform.linux_distribution(), # pylint: disable=W1505 | 600 | 'dist': platform.linux_distribution(), # pylint: disable=W1505 |
51 | 601 | } | 601 | } |
52 | 602 | plat = info['platform'].lower() | ||
53 | 603 | # Try to get more info about what it actually is, in a format | ||
54 | 604 | # that we can easily use across linux and variants... | ||
55 | 605 | if plat.startswith('darwin'): | ||
56 | 606 | info['variant'] = 'darwin' | ||
57 | 607 | elif plat.endswith("bsd"): | ||
58 | 608 | info['variant'] = 'bsd' | ||
59 | 609 | elif plat.startswith('win'): | ||
60 | 610 | info['variant'] = 'windows' | ||
61 | 611 | elif 'linux' in plat: | ||
62 | 612 | # Try to get a single string out of these... | ||
63 | 613 | linux_dist, _version, _id = info['dist'] | ||
64 | 614 | linux_dist = linux_dist.lower() | ||
65 | 615 | if linux_dist in ('ubuntu', 'linuxmint', 'mint'): | ||
66 | 616 | info['variant'] = 'ubuntu' | ||
67 | 617 | else: | ||
68 | 618 | for prefix, variant in [('redhat', 'rhel'), | ||
69 | 619 | ('centos', 'centos'), | ||
70 | 620 | ('fedora', 'fedora'), | ||
71 | 621 | ('debian', 'debian')]: | ||
72 | 622 | if linux_dist.startswith(prefix): | ||
73 | 623 | info['variant'] = variant | ||
74 | 624 | if 'variant' not in info: | ||
75 | 625 | info['variant'] = 'linux' | ||
76 | 626 | if 'variant' not in info: | ||
77 | 627 | info['variant'] = 'unknown' | ||
78 | 628 | return info | ||
79 | 602 | 629 | ||
80 | 603 | 630 | ||
81 | 604 | def get_cfg_option_list(yobj, key, default=None): | 631 | def get_cfg_option_list(yobj, key, default=None): |
82 | diff --git a/config/cloud.cfg b/config/cloud.cfg | |||
83 | 605 | deleted file mode 100644 | 632 | deleted file mode 100644 |
84 | index 1b93e7f..0000000 | |||
85 | --- a/config/cloud.cfg | |||
86 | +++ /dev/null | |||
87 | @@ -1,117 +0,0 @@ | |||
88 | 1 | # The top level settings are used as module | ||
89 | 2 | # and system configuration. | ||
90 | 3 | |||
91 | 4 | # A set of users which may be applied and/or used by various modules | ||
92 | 5 | # when a 'default' entry is found it will reference the 'default_user' | ||
93 | 6 | # from the distro configuration specified below | ||
94 | 7 | users: | ||
95 | 8 | - default | ||
96 | 9 | |||
97 | 10 | # If this is set, 'root' will not be able to ssh in and they | ||
98 | 11 | # will get a message to login instead as the above $user (ubuntu) | ||
99 | 12 | disable_root: true | ||
100 | 13 | |||
101 | 14 | # This will cause the set+update hostname module to not operate (if true) | ||
102 | 15 | preserve_hostname: false | ||
103 | 16 | |||
104 | 17 | # Example datasource config | ||
105 | 18 | # datasource: | ||
106 | 19 | # Ec2: | ||
107 | 20 | # metadata_urls: [ 'blah.com' ] | ||
108 | 21 | # timeout: 5 # (defaults to 50 seconds) | ||
109 | 22 | # max_wait: 10 # (defaults to 120 seconds) | ||
110 | 23 | |||
111 | 24 | # The modules that run in the 'init' stage | ||
112 | 25 | cloud_init_modules: | ||
113 | 26 | - migrator | ||
114 | 27 | - ubuntu-init-switch | ||
115 | 28 | - seed_random | ||
116 | 29 | - bootcmd | ||
117 | 30 | - write-files | ||
118 | 31 | - growpart | ||
119 | 32 | - resizefs | ||
120 | 33 | - disk_setup | ||
121 | 34 | - mounts | ||
122 | 35 | - set_hostname | ||
123 | 36 | - update_hostname | ||
124 | 37 | - update_etc_hosts | ||
125 | 38 | - ca-certs | ||
126 | 39 | - rsyslog | ||
127 | 40 | - users-groups | ||
128 | 41 | - ssh | ||
129 | 42 | |||
130 | 43 | # The modules that run in the 'config' stage | ||
131 | 44 | cloud_config_modules: | ||
132 | 45 | # Emit the cloud config ready event | ||
133 | 46 | # this can be used by upstart jobs for 'start on cloud-config'. | ||
134 | 47 | - emit_upstart | ||
135 | 48 | - snap_config | ||
136 | 49 | - ssh-import-id | ||
137 | 50 | - locale | ||
138 | 51 | - set-passwords | ||
139 | 52 | - grub-dpkg | ||
140 | 53 | - apt-pipelining | ||
141 | 54 | - apt-configure | ||
142 | 55 | - ntp | ||
143 | 56 | - timezone | ||
144 | 57 | - disable-ec2-metadata | ||
145 | 58 | - runcmd | ||
146 | 59 | - byobu | ||
147 | 60 | |||
148 | 61 | # The modules that run in the 'final' stage | ||
149 | 62 | cloud_final_modules: | ||
150 | 63 | - snappy | ||
151 | 64 | - package-update-upgrade-install | ||
152 | 65 | - fan | ||
153 | 66 | - landscape | ||
154 | 67 | - lxd | ||
155 | 68 | - puppet | ||
156 | 69 | - chef | ||
157 | 70 | - salt-minion | ||
158 | 71 | - mcollective | ||
159 | 72 | - rightscale_userdata | ||
160 | 73 | - scripts-vendor | ||
161 | 74 | - scripts-per-once | ||
162 | 75 | - scripts-per-boot | ||
163 | 76 | - scripts-per-instance | ||
164 | 77 | - scripts-user | ||
165 | 78 | - ssh-authkey-fingerprints | ||
166 | 79 | - keys-to-console | ||
167 | 80 | - phone-home | ||
168 | 81 | - final-message | ||
169 | 82 | - power-state-change | ||
170 | 83 | |||
171 | 84 | # System and/or distro specific settings | ||
172 | 85 | # (not accessible to handlers/transforms) | ||
173 | 86 | system_info: | ||
174 | 87 | # This will affect which distro class gets used | ||
175 | 88 | distro: ubuntu | ||
176 | 89 | # Default user name + that default users groups (if added/used) | ||
177 | 90 | default_user: | ||
178 | 91 | name: ubuntu | ||
179 | 92 | lock_passwd: True | ||
180 | 93 | gecos: Ubuntu | ||
181 | 94 | groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video] | ||
182 | 95 | sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
183 | 96 | shell: /bin/bash | ||
184 | 97 | # Other config here will be given to the distro class and/or path classes | ||
185 | 98 | paths: | ||
186 | 99 | cloud_dir: /var/lib/cloud/ | ||
187 | 100 | templates_dir: /etc/cloud/templates/ | ||
188 | 101 | upstart_dir: /etc/init/ | ||
189 | 102 | package_mirrors: | ||
190 | 103 | - arches: [i386, amd64] | ||
191 | 104 | failsafe: | ||
192 | 105 | primary: http://archive.ubuntu.com/ubuntu | ||
193 | 106 | security: http://security.ubuntu.com/ubuntu | ||
194 | 107 | search: | ||
195 | 108 | primary: | ||
196 | 109 | - http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/ | ||
197 | 110 | - http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/ | ||
198 | 111 | - http://%(region)s.clouds.archive.ubuntu.com/ubuntu/ | ||
199 | 112 | security: [] | ||
200 | 113 | - arches: [armhf, armel, default] | ||
201 | 114 | failsafe: | ||
202 | 115 | primary: http://ports.ubuntu.com/ubuntu-ports | ||
203 | 116 | security: http://ports.ubuntu.com/ubuntu-ports | ||
204 | 117 | ssh_svcname: ssh | ||
205 | diff --git a/config/cloud.cfg-freebsd b/config/cloud.cfg-freebsd | |||
206 | 118 | deleted file mode 100644 | 0 | deleted file mode 100644 |
207 | index d666c39..0000000 | |||
208 | --- a/config/cloud.cfg-freebsd | |||
209 | +++ /dev/null | |||
210 | @@ -1,88 +0,0 @@ | |||
211 | 1 | # The top level settings are used as module | ||
212 | 2 | # and system configuration. | ||
213 | 3 | |||
214 | 4 | syslog_fix_perms: root:wheel | ||
215 | 5 | |||
216 | 6 | # This should not be required, but leave it in place until the real cause of | ||
217 | 7 | # not beeing able to find -any- datasources is resolved. | ||
218 | 8 | datasource_list: ['ConfigDrive', 'Azure', 'OpenStack', 'Ec2'] | ||
219 | 9 | |||
220 | 10 | # A set of users which may be applied and/or used by various modules | ||
221 | 11 | # when a 'default' entry is found it will reference the 'default_user' | ||
222 | 12 | # from the distro configuration specified below | ||
223 | 13 | users: | ||
224 | 14 | - default | ||
225 | 15 | |||
226 | 16 | # If this is set, 'root' will not be able to ssh in and they | ||
227 | 17 | # will get a message to login instead as the above $user (ubuntu) | ||
228 | 18 | disable_root: false | ||
229 | 19 | |||
230 | 20 | # This will cause the set+update hostname module to not operate (if true) | ||
231 | 21 | preserve_hostname: false | ||
232 | 22 | |||
233 | 23 | # Example datasource config | ||
234 | 24 | # datasource: | ||
235 | 25 | # Ec2: | ||
236 | 26 | # metadata_urls: [ 'blah.com' ] | ||
237 | 27 | # timeout: 5 # (defaults to 50 seconds) | ||
238 | 28 | # max_wait: 10 # (defaults to 120 seconds) | ||
239 | 29 | |||
240 | 30 | # The modules that run in the 'init' stage | ||
241 | 31 | cloud_init_modules: | ||
242 | 32 | # - migrator | ||
243 | 33 | - seed_random | ||
244 | 34 | - bootcmd | ||
245 | 35 | # - write-files | ||
246 | 36 | - growpart | ||
247 | 37 | - resizefs | ||
248 | 38 | - set_hostname | ||
249 | 39 | - update_hostname | ||
250 | 40 | # - update_etc_hosts | ||
251 | 41 | # - ca-certs | ||
252 | 42 | # - rsyslog | ||
253 | 43 | - users-groups | ||
254 | 44 | - ssh | ||
255 | 45 | |||
256 | 46 | # The modules that run in the 'config' stage | ||
257 | 47 | cloud_config_modules: | ||
258 | 48 | # - disk_setup | ||
259 | 49 | # - mounts | ||
260 | 50 | - ssh-import-id | ||
261 | 51 | - locale | ||
262 | 52 | - set-passwords | ||
263 | 53 | - package-update-upgrade-install | ||
264 | 54 | # - landscape | ||
265 | 55 | - timezone | ||
266 | 56 | # - puppet | ||
267 | 57 | # - chef | ||
268 | 58 | # - salt-minion | ||
269 | 59 | # - mcollective | ||
270 | 60 | - disable-ec2-metadata | ||
271 | 61 | - runcmd | ||
272 | 62 | # - byobu | ||
273 | 63 | |||
274 | 64 | # The modules that run in the 'final' stage | ||
275 | 65 | cloud_final_modules: | ||
276 | 66 | - rightscale_userdata | ||
277 | 67 | - scripts-vendor | ||
278 | 68 | - scripts-per-once | ||
279 | 69 | - scripts-per-boot | ||
280 | 70 | - scripts-per-instance | ||
281 | 71 | - scripts-user | ||
282 | 72 | - ssh-authkey-fingerprints | ||
283 | 73 | - keys-to-console | ||
284 | 74 | - phone-home | ||
285 | 75 | - final-message | ||
286 | 76 | - power-state-change | ||
287 | 77 | |||
288 | 78 | # System and/or distro specific settings | ||
289 | 79 | # (not accessible to handlers/transforms) | ||
290 | 80 | system_info: | ||
291 | 81 | distro: freebsd | ||
292 | 82 | default_user: | ||
293 | 83 | name: freebsd | ||
294 | 84 | lock_passwd: True | ||
295 | 85 | gecos: FreeBSD | ||
296 | 86 | groups: [wheel] | ||
297 | 87 | sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
298 | 88 | shell: /bin/tcsh | ||
299 | diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl | |||
300 | 89 | new file mode 100644 | 0 | new file mode 100644 |
301 | index 0000000..5af2a88 | |||
302 | --- /dev/null | |||
303 | +++ b/config/cloud.cfg.tmpl | |||
304 | @@ -0,0 +1,194 @@ | |||
305 | 1 | ## template:jinja | ||
306 | 2 | # The top level settings are used as module | ||
307 | 3 | # and system configuration. | ||
308 | 4 | |||
309 | 5 | {% if variant in ["bsd"] %} | ||
310 | 6 | syslog_fix_perms: root:wheel | ||
311 | 7 | {% endif %} | ||
312 | 8 | # A set of users which may be applied and/or used by various modules | ||
313 | 9 | # when a 'default' entry is found it will reference the 'default_user' | ||
314 | 10 | # from the distro configuration specified below | ||
315 | 11 | users: | ||
316 | 12 | - default | ||
317 | 13 | |||
318 | 14 | # If this is set, 'root' will not be able to ssh in and they | ||
319 | 15 | # will get a message to login instead as the default $user | ||
320 | 16 | {% if variant in ["bsd"] %} | ||
321 | 17 | disable_root: false | ||
322 | 18 | {% else %} | ||
323 | 19 | disable_root: true | ||
324 | 20 | {% endif %} | ||
325 | 21 | |||
326 | 22 | {% if variant in ["centos", "fedora", "rhel"] %} | ||
327 | 23 | mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2'] | ||
328 | 24 | resize_rootfs_tmp: /dev | ||
329 | 25 | ssh_deletekeys: 0 | ||
330 | 26 | ssh_genkeytypes: ~ | ||
331 | 27 | ssh_pwauth: 0 | ||
332 | 28 | |||
333 | 29 | {% endif %} | ||
334 | 30 | # This will cause the set+update hostname module to not operate (if true) | ||
335 | 31 | preserve_hostname: false | ||
336 | 32 | |||
337 | 33 | {% if variant in ["bsd"] %} | ||
338 | 34 | # This should not be required, but leave it in place until the real cause of | ||
339 | 35 | # not beeing able to find -any- datasources is resolved. | ||
340 | 36 | datasource_list: ['ConfigDrive', 'Azure', 'OpenStack', 'Ec2'] | ||
341 | 37 | {% endif %} | ||
342 | 38 | # Example datasource config | ||
343 | 39 | # datasource: | ||
344 | 40 | # Ec2: | ||
345 | 41 | # metadata_urls: [ 'blah.com' ] | ||
346 | 42 | # timeout: 5 # (defaults to 50 seconds) | ||
347 | 43 | # max_wait: 10 # (defaults to 120 seconds) | ||
348 | 44 | |||
349 | 45 | # The modules that run in the 'init' stage | ||
350 | 46 | cloud_init_modules: | ||
351 | 47 | - migrator | ||
352 | 48 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
353 | 49 | - ubuntu-init-switch | ||
354 | 50 | {% endif %} | ||
355 | 51 | - seed_random | ||
356 | 52 | - bootcmd | ||
357 | 53 | - write-files | ||
358 | 54 | - growpart | ||
359 | 55 | - resizefs | ||
360 | 56 | {% if variant not in ["bsd"] %} | ||
361 | 57 | - disk_setup | ||
362 | 58 | - mounts | ||
363 | 59 | {% endif %} | ||
364 | 60 | - set_hostname | ||
365 | 61 | - update_hostname | ||
366 | 62 | {% if variant not in ["bsd"] %} | ||
367 | 63 | - update_etc_hosts | ||
368 | 64 | - ca-certs | ||
369 | 65 | - rsyslog | ||
370 | 66 | {% endif %} | ||
371 | 67 | - users-groups | ||
372 | 68 | - ssh | ||
373 | 69 | |||
374 | 70 | # The modules that run in the 'config' stage | ||
375 | 71 | cloud_config_modules: | ||
376 | 72 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
377 | 73 | # Emit the cloud config ready event | ||
378 | 74 | # this can be used by upstart jobs for 'start on cloud-config'. | ||
379 | 75 | - emit_upstart | ||
380 | 76 | - snap_config | ||
381 | 77 | {% endif %} | ||
382 | 78 | - ssh-import-id | ||
383 | 79 | - locale | ||
384 | 80 | - set-passwords | ||
385 | 81 | {% if variant in ["rhel", "fedora"] %} | ||
386 | 82 | - spacewalk | ||
387 | 83 | - yum-add-repo | ||
388 | 84 | {% endif %} | ||
389 | 85 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
390 | 86 | - grub-dpkg | ||
391 | 87 | - apt-pipelining | ||
392 | 88 | - apt-configure | ||
393 | 89 | {% endif %} | ||
394 | 90 | {% if variant not in ["bsd"] %} | ||
395 | 91 | - ntp | ||
396 | 92 | {% endif %} | ||
397 | 93 | - timezone | ||
398 | 94 | - disable-ec2-metadata | ||
399 | 95 | - runcmd | ||
400 | 96 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
401 | 97 | - byobu | ||
402 | 98 | {% endif %} | ||
403 | 99 | |||
404 | 100 | # The modules that run in the 'final' stage | ||
405 | 101 | cloud_final_modules: | ||
406 | 102 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
407 | 103 | - snappy | ||
408 | 104 | {% endif %} | ||
409 | 105 | - package-update-upgrade-install | ||
410 | 106 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
411 | 107 | - fan | ||
412 | 108 | - landscape | ||
413 | 109 | - lxd | ||
414 | 110 | {% endif %} | ||
415 | 111 | {% if variant not in ["bsd"] %} | ||
416 | 112 | - puppet | ||
417 | 113 | - chef | ||
418 | 114 | - salt-minion | ||
419 | 115 | - mcollective | ||
420 | 116 | {% endif %} | ||
421 | 117 | - rightscale_userdata | ||
422 | 118 | - scripts-vendor | ||
423 | 119 | - scripts-per-once | ||
424 | 120 | - scripts-per-boot | ||
425 | 121 | - scripts-per-instance | ||
426 | 122 | - scripts-user | ||
427 | 123 | - ssh-authkey-fingerprints | ||
428 | 124 | - keys-to-console | ||
429 | 125 | - phone-home | ||
430 | 126 | - final-message | ||
431 | 127 | - power-state-change | ||
432 | 128 | |||
433 | 129 | # System and/or distro specific settings | ||
434 | 130 | # (not accessible to handlers/transforms) | ||
435 | 131 | system_info: | ||
436 | 132 | # This will affect which distro class gets used | ||
437 | 133 | {% if variant in ["centos", "debian", "fedora", "rhel", "ubuntu"] %} | ||
438 | 134 | distro: {{ variant }} | ||
439 | 135 | {% elif variant in ["bsd"] %} | ||
440 | 136 | distro: freebsd | ||
441 | 137 | {% else %} | ||
442 | 138 | # Unknown/fallback distro. | ||
443 | 139 | distro: ubuntu | ||
444 | 140 | {% endif %} | ||
445 | 141 | {% if variant in ["ubuntu", "unknown", "debian"] %} | ||
446 | 142 | # Default user name + that default users groups (if added/used) | ||
447 | 143 | default_user: | ||
448 | 144 | name: ubuntu | ||
449 | 145 | lock_passwd: True | ||
450 | 146 | gecos: Ubuntu | ||
451 | 147 | groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video] | ||
452 | 148 | sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
453 | 149 | shell: /bin/bash | ||
454 | 150 | # Other config here will be given to the distro class and/or path classes | ||
455 | 151 | paths: | ||
456 | 152 | cloud_dir: /var/lib/cloud/ | ||
457 | 153 | templates_dir: /etc/cloud/templates/ | ||
458 | 154 | upstart_dir: /etc/init/ | ||
459 | 155 | package_mirrors: | ||
460 | 156 | - arches: [i386, amd64] | ||
461 | 157 | failsafe: | ||
462 | 158 | primary: http://archive.ubuntu.com/ubuntu | ||
463 | 159 | security: http://security.ubuntu.com/ubuntu | ||
464 | 160 | search: | ||
465 | 161 | primary: | ||
466 | 162 | - http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/ | ||
467 | 163 | - http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/ | ||
468 | 164 | - http://%(region)s.clouds.archive.ubuntu.com/ubuntu/ | ||
469 | 165 | security: [] | ||
470 | 166 | - arches: [armhf, armel, default] | ||
471 | 167 | failsafe: | ||
472 | 168 | primary: http://ports.ubuntu.com/ubuntu-ports | ||
473 | 169 | security: http://ports.ubuntu.com/ubuntu-ports | ||
474 | 170 | ssh_svcname: ssh | ||
475 | 171 | {% elif variant in ["centos", "rhel", "fedora"] %} | ||
476 | 172 | # Default user name + that default users groups (if added/used) | ||
477 | 173 | default_user: | ||
478 | 174 | name: {{ variant }} | ||
479 | 175 | lock_passwd: True | ||
480 | 176 | gecos: {{ variant }} Cloud User | ||
481 | 177 | groups: [wheel, adm, systemd-journal] | ||
482 | 178 | sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
483 | 179 | shell: /bin/bash | ||
484 | 180 | # Other config here will be given to the distro class and/or path classes | ||
485 | 181 | paths: | ||
486 | 182 | cloud_dir: /var/lib/cloud/ | ||
487 | 183 | templates_dir: /etc/cloud/templates/ | ||
488 | 184 | ssh_svcname: sshd | ||
489 | 185 | {% elif variant in ["bsd"] %} | ||
490 | 186 | # Default user name + that default users groups (if added/used) | ||
491 | 187 | default_user: | ||
492 | 188 | name: freebsd | ||
493 | 189 | lock_passwd: True | ||
494 | 190 | gecos: FreeBSD | ||
495 | 191 | groups: [wheel] | ||
496 | 192 | sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
497 | 193 | shell: /bin/tcsh | ||
498 | 194 | {% endif %} | ||
499 | diff --git a/setup.py b/setup.py | |||
500 | index 4616599..d522328 100755 | |||
501 | --- a/setup.py | |||
502 | +++ b/setup.py | |||
503 | @@ -10,8 +10,11 @@ | |||
504 | 10 | 10 | ||
505 | 11 | from glob import glob | 11 | from glob import glob |
506 | 12 | 12 | ||
507 | 13 | import atexit | ||
508 | 13 | import os | 14 | import os |
509 | 15 | import shutil | ||
510 | 14 | import sys | 16 | import sys |
511 | 17 | import tempfile | ||
512 | 15 | 18 | ||
513 | 16 | import setuptools | 19 | import setuptools |
514 | 17 | from setuptools.command.install import install | 20 | from setuptools.command.install import install |
515 | @@ -53,47 +56,15 @@ def pkg_config_read(library, var): | |||
516 | 53 | cmd = ['pkg-config', '--variable=%s' % var, library] | 56 | cmd = ['pkg-config', '--variable=%s' % var, library] |
517 | 54 | try: | 57 | try: |
518 | 55 | (path, err) = tiny_p(cmd) | 58 | (path, err) = tiny_p(cmd) |
519 | 59 | path = path.strip() | ||
520 | 56 | except Exception: | 60 | except Exception: |
523 | 57 | return fallbacks[library][var] | 61 | path = fallbacks[library][var] |
524 | 58 | return str(path).strip() | 62 | if path.startswith("/"): |
525 | 63 | path = path[1:] | ||
526 | 59 | 64 | ||
527 | 65 | return path | ||
528 | 60 | 66 | ||
529 | 61 | INITSYS_FILES = { | ||
530 | 62 | 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)], | ||
531 | 63 | 'sysvinit_freebsd': [f for f in glob('sysvinit/freebsd/*') if is_f(f)], | ||
532 | 64 | 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)], | ||
533 | 65 | 'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)], | ||
534 | 66 | 'systemd': [f for f in (glob('systemd/*.service') + | ||
535 | 67 | glob('systemd/*.target')) if is_f(f)], | ||
536 | 68 | 'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)], | ||
537 | 69 | 'upstart': [f for f in glob('upstart/*') if is_f(f)], | ||
538 | 70 | } | ||
539 | 71 | INITSYS_ROOTS = { | ||
540 | 72 | 'sysvinit': '/etc/rc.d/init.d', | ||
541 | 73 | 'sysvinit_freebsd': '/usr/local/etc/rc.d', | ||
542 | 74 | 'sysvinit_deb': '/etc/init.d', | ||
543 | 75 | 'sysvinit_openrc': '/etc/init.d', | ||
544 | 76 | 'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'), | ||
545 | 77 | 'systemd.generators': pkg_config_read('systemd', | ||
546 | 78 | 'systemdsystemgeneratordir'), | ||
547 | 79 | 'upstart': '/etc/init/', | ||
548 | 80 | } | ||
549 | 81 | INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()]) | ||
550 | 82 | |||
551 | 83 | # Install everything in the right location and take care of Linux (default) and | ||
552 | 84 | # FreeBSD systems. | ||
553 | 85 | USR = "/usr" | ||
554 | 86 | ETC = "/etc" | ||
555 | 87 | USR_LIB_EXEC = "/usr/lib" | ||
556 | 88 | LIB = "/lib" | ||
557 | 89 | if os.uname()[0] == 'FreeBSD': | ||
558 | 90 | USR = "/usr/local" | ||
559 | 91 | USR_LIB_EXEC = "/usr/local/lib" | ||
560 | 92 | elif os.path.isfile('/etc/redhat-release'): | ||
561 | 93 | USR_LIB_EXEC = "/usr/libexec" | ||
562 | 94 | 67 | ||
563 | 95 | |||
564 | 96 | # Avoid having datafiles installed in a virtualenv... | ||
565 | 97 | def in_virtualenv(): | 68 | def in_virtualenv(): |
566 | 98 | try: | 69 | try: |
567 | 99 | if sys.real_prefix == sys.prefix: | 70 | if sys.real_prefix == sys.prefix: |
568 | @@ -116,6 +87,66 @@ def read_requires(): | |||
569 | 116 | return str(deps).splitlines() | 87 | return str(deps).splitlines() |
570 | 117 | 88 | ||
571 | 118 | 89 | ||
572 | 90 | def render_cloud_cfg(): | ||
573 | 91 | """render cloud.cfg into a tmpdir under same dir as setup.py | ||
574 | 92 | |||
575 | 93 | This is rendered to a temporary directory under the top level | ||
576 | 94 | directory with the name 'cloud.cfg'. The reason for not just rendering | ||
577 | 95 | to config/cloud.cfg is for a.) don't want to write over contents | ||
578 | 96 | in that file if user had something there. b.) debuild will complain | ||
579 | 97 | that files are different outside of the debian directory.""" | ||
580 | 98 | |||
581 | 99 | # older versions of tox use bdist (xenial), and then install from there. | ||
582 | 100 | # newer versions just use install. | ||
583 | 101 | if not (sys.argv[1] == 'install' or sys.argv[1].startswith('bdist*')): | ||
584 | 102 | return 'config/cloud.cfg.tmpl' | ||
585 | 103 | topdir = os.path.dirname(sys.argv[0]) | ||
586 | 104 | tmpd = tempfile.mkdtemp(dir=topdir) | ||
587 | 105 | atexit.register(shutil.rmtree, tmpd) | ||
588 | 106 | fpath = os.path.join(tmpd, 'cloud.cfg') | ||
589 | 107 | tiny_p([sys.executable, './tools/render-cloudcfg', | ||
590 | 108 | 'config/cloud.cfg.tmpl', fpath]) | ||
591 | 109 | # relpath is relative to setup.py | ||
592 | 110 | relpath = os.path.join(os.path.basename(tmpd), 'cloud.cfg') | ||
593 | 111 | return relpath | ||
594 | 112 | |||
595 | 113 | |||
596 | 114 | INITSYS_FILES = { | ||
597 | 115 | 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)], | ||
598 | 116 | 'sysvinit_freebsd': [f for f in glob('sysvinit/freebsd/*') if is_f(f)], | ||
599 | 117 | 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)], | ||
600 | 118 | 'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)], | ||
601 | 119 | 'systemd': [f for f in (glob('systemd/*.service') + | ||
602 | 120 | glob('systemd/*.target')) if is_f(f)], | ||
603 | 121 | 'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)], | ||
604 | 122 | 'upstart': [f for f in glob('upstart/*') if is_f(f)], | ||
605 | 123 | } | ||
606 | 124 | INITSYS_ROOTS = { | ||
607 | 125 | 'sysvinit': 'etc/rc.d/init.d', | ||
608 | 126 | 'sysvinit_freebsd': 'usr/local/etc/rc.d', | ||
609 | 127 | 'sysvinit_deb': 'etc/init.d', | ||
610 | 128 | 'sysvinit_openrc': 'etc/init.d', | ||
611 | 129 | 'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'), | ||
612 | 130 | 'systemd.generators': pkg_config_read('systemd', | ||
613 | 131 | 'systemdsystemgeneratordir'), | ||
614 | 132 | 'upstart': 'etc/init/', | ||
615 | 133 | } | ||
616 | 134 | INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()]) | ||
617 | 135 | |||
618 | 136 | |||
619 | 137 | # Install everything in the right location and take care of Linux (default) and | ||
620 | 138 | # FreeBSD systems. | ||
621 | 139 | USR = "usr" | ||
622 | 140 | ETC = "etc" | ||
623 | 141 | USR_LIB_EXEC = "usr/lib" | ||
624 | 142 | LIB = "lib" | ||
625 | 143 | if os.uname()[0] == 'FreeBSD': | ||
626 | 144 | USR = "usr/local" | ||
627 | 145 | USR_LIB_EXEC = "usr/local/lib" | ||
628 | 146 | elif os.path.isfile('/etc/redhat-release'): | ||
629 | 147 | USR_LIB_EXEC = "usr/libexec" | ||
630 | 148 | |||
631 | 149 | |||
632 | 119 | # TODO: Is there a better way to do this?? | 150 | # TODO: Is there a better way to do this?? |
633 | 120 | class InitsysInstallData(install): | 151 | class InitsysInstallData(install): |
634 | 121 | init_system = None | 152 | init_system = None |
635 | @@ -155,36 +186,39 @@ class InitsysInstallData(install): | |||
636 | 155 | self.distribution.reinitialize_command('install_data', True) | 186 | self.distribution.reinitialize_command('install_data', True) |
637 | 156 | 187 | ||
638 | 157 | 188 | ||
669 | 158 | if in_virtualenv(): | 189 | if not in_virtualenv(): |
670 | 159 | data_files = [] | 190 | USR = "/" + USR |
671 | 160 | cmdclass = {} | 191 | ETC = "/" + ETC |
672 | 161 | else: | 192 | USR_LIB_EXEC = "/" + USR_LIB_EXEC |
673 | 162 | data_files = [ | 193 | LIB = "/" + LIB |
674 | 163 | (ETC + '/cloud', glob('config/*.cfg')), | 194 | for k in INITSYS_ROOTS.keys(): |
675 | 164 | (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')), | 195 | INITSYS_ROOTS[k] = "/" + INITSYS_ROOTS[k] |
676 | 165 | (ETC + '/cloud/templates', glob('templates/*')), | 196 | |
677 | 166 | (USR_LIB_EXEC + '/cloud-init', ['tools/ds-identify', | 197 | data_files = [ |
678 | 167 | 'tools/uncloud-init', | 198 | (ETC + '/cloud', [render_cloud_cfg()]), |
679 | 168 | 'tools/write-ssh-key-fingerprints']), | 199 | (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')), |
680 | 169 | (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]), | 200 | (ETC + '/cloud/templates', glob('templates/*')), |
681 | 170 | (USR + '/share/doc/cloud-init/examples', | 201 | (USR_LIB_EXEC + '/cloud-init', ['tools/ds-identify', |
682 | 171 | [f for f in glob('doc/examples/*') if is_f(f)]), | 202 | 'tools/uncloud-init', |
683 | 172 | (USR + '/share/doc/cloud-init/examples/seed', | 203 | 'tools/write-ssh-key-fingerprints']), |
684 | 173 | [f for f in glob('doc/examples/seed/*') if is_f(f)]), | 204 | (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]), |
685 | 174 | ] | 205 | (USR + '/share/doc/cloud-init/examples', |
686 | 175 | if os.uname()[0] != 'FreeBSD': | 206 | [f for f in glob('doc/examples/*') if is_f(f)]), |
687 | 176 | data_files.extend([ | 207 | (USR + '/share/doc/cloud-init/examples/seed', |
688 | 177 | (ETC + '/NetworkManager/dispatcher.d/', | 208 | [f for f in glob('doc/examples/seed/*') if is_f(f)]), |
689 | 178 | ['tools/hook-network-manager']), | 209 | ] |
690 | 179 | (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']), | 210 | if os.uname()[0] != 'FreeBSD': |
691 | 180 | (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')]) | 211 | data_files.extend([ |
692 | 181 | ]) | 212 | (ETC + '/NetworkManager/dispatcher.d/', |
693 | 182 | # Use a subclass for install that handles | 213 | ['tools/hook-network-manager']), |
694 | 183 | # adding on the right init system configuration files | 214 | (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']), |
695 | 184 | cmdclass = { | 215 | (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')]) |
696 | 185 | 'install': InitsysInstallData, | 216 | ]) |
697 | 186 | } | 217 | # Use a subclass for install that handles |
698 | 187 | 218 | # adding on the right init system configuration files | |
699 | 219 | cmdclass = { | ||
700 | 220 | 'install': InitsysInstallData, | ||
701 | 221 | } | ||
702 | 188 | 222 | ||
703 | 189 | requirements = read_requires() | 223 | requirements = read_requires() |
704 | 190 | if sys.version_info < (3,): | 224 | if sys.version_info < (3,): |
705 | diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg | |||
706 | 191 | new file mode 100755 | 225 | new file mode 100755 |
707 | index 0000000..e624541 | |||
708 | --- /dev/null | |||
709 | +++ b/tools/render-cloudcfg | |||
710 | @@ -0,0 +1,43 @@ | |||
711 | 1 | #!/usr/bin/env python3 | ||
712 | 2 | |||
713 | 3 | import argparse | ||
714 | 4 | import os | ||
715 | 5 | import sys | ||
716 | 6 | |||
717 | 7 | if "avoid-pep8-E402-import-not-top-of-file": | ||
718 | 8 | _tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | ||
719 | 9 | sys.path.insert(0, _tdir) | ||
720 | 10 | from cloudinit import templater | ||
721 | 11 | from cloudinit import util | ||
722 | 12 | from cloudinit.atomic_helper import write_file | ||
723 | 13 | |||
724 | 14 | |||
725 | 15 | def main(): | ||
726 | 16 | parser = argparse.ArgumentParser() | ||
727 | 17 | variants = ["bsd", "centos", "fedora", "rhel", "ubuntu", "unknown"] | ||
728 | 18 | platform = util.system_info() | ||
729 | 19 | parser.add_argument( | ||
730 | 20 | "--variant", default=platform['variant'], action="store", | ||
731 | 21 | help="define the variant.", choices=variants) | ||
732 | 22 | parser.add_argument( | ||
733 | 23 | "template", nargs="?", action="store", | ||
734 | 24 | default='./config/cloud.cfg.tmpl', | ||
735 | 25 | help="Path to the cloud.cfg template") | ||
736 | 26 | parser.add_argument( | ||
737 | 27 | "output", nargs="?", action="store", default="-", | ||
738 | 28 | help="Output file. Use '-' to write to stdout") | ||
739 | 29 | |||
740 | 30 | args = parser.parse_args() | ||
741 | 31 | |||
742 | 32 | with open(args.template, 'r') as fh: | ||
743 | 33 | contents = fh.read() | ||
744 | 34 | tpl_params = {'variant': args.variant} | ||
745 | 35 | contents = (templater.render_string(contents, tpl_params)).rstrip() + "\n" | ||
746 | 36 | util.load_yaml(contents) | ||
747 | 37 | if args.output == "-": | ||
748 | 38 | sys.stdout.write(contents) | ||
749 | 39 | else: | ||
750 | 40 | write_file(args.output, contents, omode="w") | ||
751 | 41 | |||
752 | 42 | if __name__ == '__main__': | ||
753 | 43 | main() |
FAILED: Continuous integration, rev:0a10399df14 0601465029080c0 e2fdf4c4bf6e34 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 457/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/457/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/457/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 457/console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/457/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/457/ console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 457/rebuild
https:/