【发布时间】:2022-04-13 23:19:57
【问题描述】:
将 ARM 模板 https://pastebin.com/ShjazbpR 与 cloud-init 脚本一起使用:
#cloud-config
# Install additional packages on first boot
#
# Default: none
#
# if packages are specified, this apt_update will be set to true
#
# packages may be supplied as a single package name or as a list
# with the format [<package>, <version>] wherein the specifc
# package version will be installed.
packages:
- pwgen
不安装 pwgen 包,也不更新包列表,因为文档 https://cloudinit.readthedocs.io/en/latest/topics/examples.html#install-arbitrary-packages 指出它应该更新包列表:# if packages are specified, this apt_update will be set to true
如果我在此模板https://pastebin.com/27s4pgiD 中使用osProfile 下的customData 属性,一切都会按预期工作,pwgen 已安装并且包列表在首次启动时更新。
有谁知道为什么 userData 不起作用? Azure 文档 https://docs.microsoft.com/azure/virtual-machines/user-data 声明 Azure 支持 userData。
【问题讨论】:
标签: azure user-data cloud-init