I've tried something like this, to no avail:
code:
#cloud-config
hostname: HAProxy1
fqdn: HAProxy1.domain.com
ssh_pwauth: yes
write_files:
- path: /etc/sysconfig/network-scripts/ifcfg-eth0
content: |
DEVICE=eth0
BOOTPROTO="none"
IPADDR="@@{HAProxy1.IP_Address}@@"
PREFIX="24"
GATEWAY="172.25.51.254"
DOMAIN="VIPCUSTOMERS.COM VTINFO.COM"
DEFROUTE="yes"
ONBOOT="yes"
DNS1="172.25.51.10"
DNS2="172.25.51.2"
IPV4_FAILURE_FATAL="yes"
IPV6INIT="no"
runcmd:
- [ifdown, eth0]
- [ifup, eth0]
Where HAProxy1.IP_Address is a user defined variable. Any thoughts on how I might achieve this?