#cloud-config
write_files:
  - path: /etc/systemd/system/wc-notify.service
    owner: "root:root"
    permissions: "0644"
    content: |
      [Unit]
      Description=Notify Heat

      [Service]
      Type=oneshot
      EnvironmentFile=/etc/sysconfig/heat-params
      ExecStart=/etc/sysconfig/wc-notify.sh

      [Install]
      WantedBy=multi-user.target

  - path: /etc/sysconfig/wc-notify.sh
    owner: "root:root"
    permissions: "0755"
    content: |
      #!/bin/bash -v
      command="$WAIT_CURL $VERIFY_CA --data-binary '{\"status\": \"SUCCESS\"}'"
      eval $(echo "$command")
