cloud-config似乎不运行一次脚本,runcmd或每次引导模块

时间:2018-11-17 01:55:57

标签: ubuntu-16.04 cloud-init

下面的cloud-init.cfg似乎不会运行脚本一次,runcmd或每次引导模块...但是它将运行每次引导脚本模块。

每运行一次cloud-init -d single -n scripts一次,则在日志输出中没有显示错误。

users:
 - default

disable_root: 1
ssh_pwauth: 0

mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
resize_rootfs_tmp: /dev
ssh_svcname: sshd
ssh_deletekeys: True
ssh_genkeytypes: [ 'rsa', 'ed25519' ]
syslog_fix_perms: ~

cloud_init_modules:
 - migrator
 - bootcmd
 - write-files
 - growpart
 - resizefs
 - set_hostname
 - update_hostname
 - users-groups
 - ssh

cloud_config_modules:
 - mounts
 - locale
 - package-update-upgrade-install
 - timezone
 - chef
 - runcmd
 - ssh-import-id

cloud_final_modules:
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user
 - ssh-authkey-fingerprints
 - keys-to-console
 - final-message
 - power-state-change 

system_info:
  distro: ubuntu
  default_user:
    name: fred
     lock_passwd: true
     gecos: Fred The User
     groups: [users, adm, systemd-journal]
    shell: /bin/bash

  paths:
    cloud_dir: /var/lib/cloud
    templates_dir: /etc/cloud/templates
  ssh_svcname: sshd

bootcmd:
- "/bin/echo test >> /tmp/my_boot.txt"

runcmd:
- "/bin/echo sample >> /tmp/my_run.txt"

final_message: cloud-init finished 
# vim:syntax=yaml  

有人可以告诉我我想念什么吗?

0 个答案:

没有答案