2015-12-04 16 views

risposta

15

Da https://git.launchpad.net/cloud-init/tree/config/cloud.cfg (grazie a 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 

Inoltre:

C'è configurazione fondendo "L'ordine è il seguente: - file di configurazione CLI sovrascrivono i file di configurazione di ambiente quali file di configurazione dell'istanza di override che sovrascrive datasource configurazioni che sovrascrivono la configurazione di base che sovrascrive la configurazione di default ". (Vedi Changelog)

All'interno dello script generato singole directory gli script vengono eseguiti nell'ordine in pitone "ordinato()" integrato

NOTA: anche se questo era corrette al momento di rispondere, guardando il respository (a partire da settembre 2017) di cui sopra v'è ora un file di modello cloud.cfg.tmpl che ha leggermente impostazioni diverse per differenti distribuzioni

# 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

c'è un modo per forzare un cambiamento di esecuzione? Per esempio, ho bisogno di assicurarmi di installare dirmngr (manca nella mia distribuzione) prima che apt venga eseguito e tenti di importare una chiave d'origine in quanto fallirà. Quindi mi piacerebbe continuare a installare il resto dei miei pacchetti normalmente. – Tristan

+1

C'è qualche caso in cui l'ordine di esecuzione non è rispettato? Nell'immagine di Ubuntu Cloud 16.04, 'runcmd' è messo nella fase' config', e 'package-update-upgrade-install' è messo nella fase' final', ma posso eseguire 'runcmd' dopo l'installazione del pacchetto senza errori. – dvnguyen

+1

@Tristan Ho notato che ora ci sono tre passaggi per la configurazione di apt/dpkg, mayeb potresti collegarne uno? – Vorsprung