我尝试了这样的事情,无济于事:
#Cloud-Config
主机名:haproxy1
fqdn:haproxy1.domain.com
SSH_PWAUTH:是的
write_files:
- 路径:/etc/sysconfig/network-scripts/ifcfg-eth0
内容:|
设备= ETH0
bootproto =“无”
ipaddr =“ @@ {haproxy1.ip_address} @@”
前缀=“ 24”
网关=“ 172.25.51.254”
domain =“ vipcustomers.com vtinfo.com”
defroute =“是”
ONBOOT =“是”
DNS1 =“ 172.25.51.10”
dns2 =“ 172.25.51.2”
ipv4_failure_fatal =“是”
ipv6init =“否”
runcmd:
- [ifdown,eth0]
- [ifup,eth0]
其中haproxy1.ip_address是用户定义的变量。关于我如何实现这一目标有什么想法吗?
最好的答案钱德鲁
\r\n
\r\nhttps:\/\/portal.nutanix.com\/#\/page\/docs\/details?targetId=Nutanix-Calm-Admin-Operations-Guide-v57:nuc-adding-configure-application-profile-t.html
\r\n
\r\nYou should have a default Application Profile already in the blueprint, you can configure the variable in the default Application profile.
\r\n
\r\nWhen you define variables in the Application profile you need to just refer to the variable as @@{variable}@@ in the scripts. So, in your case if your variable is IP_Address then just refer to it in the Cloudinit script as @@{IP_Address}@@.","className":"post__content__best_answer"}">