#cloud-config

coreos:
    units:
      - name: user-configdrive.service.d/netconf.conf
        runtime: yes
        content: |
          [Service]
          ExecStart=
          ExecStart=/usr/bin/coreos-cloudinit --oem=rackspace-onmetal
      - name: ping-out.service
        runtime: yes
        enable: yes
        content: |
          [Unit]
          After=user-config.target

          [Service]
          Type=oneshot
          RemainAfterExit=yes
          ExecStart=/usr/bin/sh -c "ping -A -c1 $(ip route | awk '/default/ { print $3 }')"

          [Install]
          WantedBy=user-config.target
      - name: media-configdrive.mount
        command: start
        runtime: yes
        content: |
          [Unit]
          Wants=user-configdrive.service
          Before=user-configdrive.service

          [Mount]
          What=/dev/disk/by-label/config-2
          Where=/media/configdrive
          Options=ro
    oem:
      id: onmetal
      name: Rackspace OnMetal
      version-id: @@OEM_VERSION_ID@@
      home-url: http://www.rackspace.com/
      bug-report-url: https://issues.flatcar.org
