Browse Source

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
changes/09/395209/1
Vijendar Komalla 5 years ago
parent
commit
490deb256e
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh
  2. +1
    -0
      magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh

+ 1
- 0
magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh 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


+ 1
- 0
magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh 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"


Loading…
Cancel
Save