title: Instruct to execute an unit after completing another unit successfully
body: <p>Friends.</p>
  
  <p>I use cloud-config to install and configure DCOS cluster.</p>
  
  <p>Normally "agentinstall.service" service takes 5 minutes to complete.</p>
  
  <p>Is it possible to instruct to systemd to execute "agentconfigure.service" ONLY AFTER "agentinstall.service" <strong>completed</strong>?</p>
  
  <pre><code>#cloud-config
  coreos:
    units:
      - name: "agentinstall.service"
        command: "start"
        content: |
          [Unit]
          Description=agent_setup
          After=network.target
  
          [Service]
          Type=simple
          User=root
          WorkingDirectory=/tmp
          ExecStartPre=/bin/curl -o /tmp/dcos_install.sh  http://bootstapnode-0.dev.myztro.internal:9090/dcos_install.sh
          ExecStartPre=/bin/chmod 755 dcos_install.sh
          ExecStart=/bin/bash dcos_install.sh slave
  
          [Install]
          WantedBy=multi-user.target
      - name: "agentconfigure.service"
        command: "start"
        content: |
          [Unit]
          Description=agent_config
          After=agentinstall.service
  
          [Service]
          Type=simple
          User=root
          WorkingDirectory=/opt/mesosphere/etc/
          ExecStartPre=/bin/echo "MESOS_ATTRIBUTES=cluster:uploader" &gt;&gt; /opt/mesosphere/etc/mesos-slave-common
          ExecStartPre=/bin/rm -f /var/lib/mesos/slave/meta/slaves/latest
          ExecStart=/usr/bin/systemctl restart dcos-mesos-slave
  
          [Install]
          WantedBy=multi-user.target
  </code></pre>
  
  <p>Thank you.</p>