diff --git a/roles/network_plugin/weave/templates/weave.service.j2 b/roles/network_plugin/weave/templates/weave.service.j2 index e901c34e73211b13578ebbf8bdf21b5acda3ec8b..2df0cb98948d33ccb1fd58e26c9d5a4b231e3882 100644 --- a/roles/network_plugin/weave/templates/weave.service.j2 +++ b/roles/network_plugin/weave/templates/weave.service.j2 @@ -6,11 +6,12 @@ After=docker.service docker.socket [Service] EnvironmentFile=-/etc/weave.env +ExecStartPre=-/usr/bin/docker rm -f weave ExecStartPre={{ bin_dir }}/weave launch-router \ $WEAVE_SUBNET \ $WEAVE_PEERS ExecStart=/usr/bin/docker attach weave -ExecStop={{ bin_dir }}/weave stop-router +ExecStop={{ bin_dir }}/weave stop [Install] WantedBy=multi-user.target diff --git a/roles/network_plugin/weave/templates/weaveproxy.service.j2 b/roles/network_plugin/weave/templates/weaveproxy.service.j2 index 29197296fa4dbd4aeb04579fb2dcac7c18f948bb..9b2a522ba881262dfb54b71f6e2401a497c7b969 100644 --- a/roles/network_plugin/weave/templates/weaveproxy.service.j2 +++ b/roles/network_plugin/weave/templates/weaveproxy.service.j2 @@ -7,6 +7,7 @@ After=docker.service docker.socket [Service] EnvironmentFile=-/etc/weave.%H.env EnvironmentFile=-/etc/weave.env +ExecStartPre=-/usr/bin/docker rm -f weaveproxy ExecStartPre={{ bin_dir }}/weave launch-proxy $WEAVEPROXY_ARGS ExecStart=/usr/bin/docker attach weaveproxy Restart=on-failure