Restart swarm infra containers if deleted

Currently a user can accidentally delete swarm infra
conatiners (swarm-manager, swarm-agent). This change is
to restart infra containers if they were deleted/killed.

Change-Id: I4640dfb3dbb4bb6684da86998424936d3128eade
Closes-Bug: #1640312
This commit is contained in:
Vijendar Komalla
2016-11-08 15:49:41 -06:00
parent fad39cf881
commit 490deb256e
2 changed files with 2 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ ExecStart=/usr/bin/docker run -e http_proxy=$HTTP_PROXY \\
join \\
--addr $myip:2375 \\
etcd://$ETCD_SERVER_IP:2379/v2/keys/swarm/
Restart=always
ExecStop=/usr/bin/docker stop swarm-agent
ExecStartPost=/usr/local/bin/notify-heat

View File

@@ -39,6 +39,7 @@ fi
cat >> /etc/systemd/system/swarm-manager.service << END_SERVICE_BOTTOM
etcd://$ETCD_SERVER_IP:2379/v2/keys/swarm/
ExecStop=/usr/bin/docker stop swarm-manager
Restart=always
ExecStartPost=/usr/bin/curl -k -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \\
--data-binary "'"'{"Status": "SUCCESS", "Reason": "Setup complete", "Data": "OK", "UniqueId": "00000"}'"'" \\
"$WAIT_HANDLE_ENDPOINT"