#cloud-config write_files: - path: /etc/systemd/system/configure-etcd.service owner: "root:root" permissions: "0644" content: | [Unit] Description=Configure etcd [Service] Type=oneshot ExecStart=/etc/sysconfig/configure-etcd.sh [Install] WantedBy=multi-user.target - path: /etc/sysconfig/configure-etcd.sh owner: "root:root" permissions: "0755" content: | #!/bin/sh . /etc/sysconfig/heat-params myip=$(ip addr show eth0 | awk '$1 == "inet" {print $2}' | cut -f1 -d/) DROP_IN_FILE=/etc/systemd/system/etcd2.service.d/20-configure-etcd.conf mkdir -p $(dirname $DROP_IN_FILE) cat > $DROP_IN_FILE <> $DROP_IN_FILE fi systemctl enable etcd2 systemctl --no-block start etcd2