【发布时间】:2020-09-02 06:36:52
【问题描述】:
我正在尝试使用terraform 的ignition provider 编写systemd service 文件,如下所示ubuntu OS
# Systemd unit data resource containing the unit definition
data "ignition_systemd_unit" "example" {
name = "example.service"
content = "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target"
}
# Ingnition config include the previous defined systemd unit data resource
data "ignition_config" "example" {
systemd = [
data.ignition_systemd_unit.example.rendered,
]
}
# Create a CoreOS server using the Igntion config.
resource "aws_instance" "web" {
# ...
user_data = data.ignition_config.example.rendered
}
在azurerm_linux_virtual_machine 中我给出了如下所示
custom_data = data.ignition_config.example.rendered
我收到如下错误
Error: expected "custom_data" to be a base64 string, got {"ignition":{"config":{},"timeouts":{},"version":"2.1.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{"units":[{"contents":"[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"example.service"}]}}
我如何使用terraform 创建一个systemd service 文件,以及我在上面的配置中缺少什么,这个ignition 是否仅适用于centos?对此的任何帮助将不胜感激
【问题讨论】:
标签: azure azure-devops terraform systemd terraform-provider-azure