【发布时间】:2018-02-25 01:43:52
【问题描述】:
我正在运行 Debian 9.1,我想在创建时使用 cloud-init 配置我的 VPS,但我遇到了一个特定的配置问题。
这是来自所提供快照的 cloud.cfg 的默认值:
# The modules that run in the 'init' stage
cloud_init_modules:
- migrator
- seed_random
- bootcmd
- write-files
- growpart
- resizefs
- disk_setup
- mounts
- 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 my cloud config ready event
# this can be used by upstart jobs for 'start on cloud-config'.
- emit_upstart
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- apt-pipelining
- apt-configure
- ntp
- timezone
- disable-ec2-metadata
- runcmd
- byobu
# The modules that run in the 'final' stage
cloud_final_modules:
- package-update-upgrade-install
- fan
- puppet
- chef
- salt-minion
- mcollective
- 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
如您所见,runcmd 将在 config 阶段执行,在 apt-configure 之后。
作为我的配置的一部分,我正在安装多个包,其中一个需要我添加一个新源并从密钥服务器导入一个密钥。有一个问题,因为导入密钥需要在系统上安装dirmngr,但Debian 9.1默认没有安装它。
但是,由于 apt-configure 在 runcmd 之前执行,我无法在尝试导入密钥之前安装 dirmngr。结果,其余配置将失败,系统将处于不需要的状态。
我该如何解决这个问题?
【问题讨论】:
标签: linux debian cloud-init