2015-12-04 31 views

Antwort

15

Von https://git.launchpad.net/cloud-init/tree/config/cloud.cfg (dank garbelini)

# The modules that run in the 'init' stage 
cloud_init_modules: 
- migrator 
- ubuntu-init-switch 
- seed_random 
- bootcmd 
- write-files 
- growpart 
- resizefs 
- set_hostname 
- update_hostname 
- update_etc_hosts 
- ca-certs 
- rsyslog 
- users-groups 
- ssh 

# The modules that run in the 'config' stage 
cloud_config_modules: 
# Emit the cloud config ready event 
# this can be used by upstart jobs for 'start on cloud-config'. 
- emit_upstart 
- disk_setup 
- mounts 
- ssh-import-id 
- locale 
- set-passwords 
- snappy 
- grub-dpkg 
- apt-pipelining 
- apt-configure 
- package-update-upgrade-install 
- fan 
- landscape 
- timezone 
- lxd 
- puppet 
- chef 
- salt-minion 
- mcollective 
- disable-ec2-metadata 
- runcmd 
- byobu 

# The modules that run in the 'final' stage 
cloud_final_modules: 
- rightscale_userdata 
- scripts-vendor 
- scripts-per-once 
- scripts-per-boot 
- scripts-per-instance 
- scripts-user 
- ssh-authkey-fingerprints 
- keys-to-console 
- phone-home 
- final-message 
- power-state-change 

Zusätzlich:

Es gibt Konfiguration „Die Reihenfolge ist die folgende Verschmelzung: - cli Konfigurationsdateien überschreiben Umgebung Konfigurationsdateien welche Überschreibung Instanz configs die override Datenquelle Configs, die Basiskonfiguration überschreiben, die Standardkonfiguration überschreibt. " (Siehe Changelog)

Innerhalb der einzelnen erzeugten Skriptverzeichnisse der Skripte werden in der Reihenfolge von dem Python „sortierte()“ builtin

Hinweis gegeben laufen: obwohl diese zum Zeitpunkt der Beantwortung korrekt war, auf der Suche respository (Stand: September 2017) wie oben erwähnt gibt es jetzt eine cloud.cfg.tmpl Template-Datei, die für verschiedene Distributionen

# The modules that run in the 'init' stage 
cloud_init_modules: 
- migrator 
- seed_random 
- bootcmd 
- write-files 
- growpart 
- resizefs 
{% if variant not in ["freebsd"] %} 
- disk_setup 
- mounts 
{% endif %} 
- set_hostname 
- update_hostname 
{% if variant not in ["freebsd"] %} 
- update_etc_hosts 
- ca-certs 
- rsyslog 
{% endif %} 
- users-groups 
- ssh 

# The modules that run in the 'config' stage 
cloud_config_modules: 
{% if variant in ["ubuntu", "unknown", "debian"] %} 
# Emit the cloud config ready event 
# this can be used by upstart jobs for 'start on cloud-config'. 
- emit_upstart 
- snap_config 
{% endif %} 
- ssh-import-id 
- locale 
- set-passwords 
{% if variant in ["rhel", "fedora"] %} 
- spacewalk 
- yum-add-repo 
{% endif %} 
{% if variant in ["ubuntu", "unknown", "debian"] %} 
- grub-dpkg 
- apt-pipelining 
- apt-configure 
{% endif %} 
{% if variant not in ["freebsd"] %} 
- ntp 
{% endif %} 
- timezone 
- disable-ec2-metadata 
- runcmd 
{% if variant in ["ubuntu", "unknown", "debian"] %} 
- byobu 
{% endif %} 

# The modules that run in the 'final' stage 
cloud_final_modules: 
{% if variant in ["ubuntu", "unknown", "debian"] %} 
- snappy 
{% endif %} 
- package-update-upgrade-install 
{% if variant in ["ubuntu", "unknown", "debian"] %} 
- fan 
- landscape 
- lxd 
{% endif %} 
{% if variant not in ["freebsd"] %} 
- puppet 
- chef 
- salt-minion 
- mcollective 
{% endif %} 
- rightscale_userdata 
- scripts-vendor 
- scripts-per-once 
- scripts-per-boot 
- scripts-per-instance 
- scripts-user 
- ssh-authkey-fingerprints 
- keys-to-console 
- phone-home 
- final-message 
- power-state-change 
+0

gibt es eine Möglichkeit zu zwingen, eine Änderung der Ausführung etwas andere Einstellungen hat? Zum Beispiel muss ich sicherstellen, dass ich dirrngr installiert habe (es fehlt in meiner Distribution), bevor apt ausgeführt wird und versucht, einen Quellschlüssel zu importieren, da dieser fehlschlagen wird. Dann möchte ich den Rest meiner Pakete wie gewohnt installieren. – Tristan

+1

Gibt es Fälle, in denen die Ausführungsreihenfolge nicht eingehalten wird? In Ubuntu Cloud 16.04 Image wird 'runcmd' in' config' stage und 'package-update-upgrade-install' in' final' stage gestellt, aber ich kann 'runcmd' nach der Paketinstallation ohne Fehler ausführen. – dvnguyen

+1

@Tristan Ich bemerke, dass es jetzt drei Schritte zur apt/dpkg config gibt, mayeb könntest du einen von ihnen haken? – Vorsprung