-
Notifications
You must be signed in to change notification settings - Fork 1
/
Patch
35 lines (31 loc) · 1.77 KB
/
Patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/magnum/templates/swarm/fragments/configure-swarm.sh b/magnum/templates/swarm/fragments/configure-swarm.sh
index 6f704d3..99e4848 100644
--- a/magnum/templates/swarm/fragments/configure-swarm.sh
+++ b/magnum/templates/swarm/fragments/configure-swarm.sh
@@ -1,5 +1,6 @@
#!/bin/sh
# This shell script will do some extra configure stuff before running services
+. /etc/sysconfig/heat-params
echo "configuring swarm ..."
@@ -7,11 +8,10 @@ echo "configuring swarm ..."
sed -i '/^DOCKER_STORAGE_OPTIONS=/ s/=.*/=--storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.datadev=\/dev\/mapper\/atomicos-docker--data --storage-opt dm.metadatadev=\/dev\/mapper\/atomicos-docker--meta/' /etc/sysconfig/docker-storage
# Set swarm image
-SWARM_IMAGE="swarm:1.0.0"
if [ -f "/etc/systemd/system/swarm-manager.service" ]; then
- sed -i 's/SWARM_IMAGE/'"${SWARM_IMAGE}"'/g' /etc/systemd/system/swarm-manager.service
+ sed -i 's/SWARM_IMAGE/'"${SWARM_IMAGE_NAME}:${SWARM_IMAGE_VERSION}"'/g' /etc/systemd/system/swarm-manager.service
fi
if [ -f "/etc/systemd/system/swarm-agent.service" ]; then
- sed -i 's/SWARM_IMAGE/'"${SWARM_IMAGE}"'/g' /etc/systemd/system/swarm-agent.service
+ sed -i 's/SWARM_IMAGE/'"${SWARM_IMAGE_NAME}:${SWARM_IMAGE_VERSION}"'/g' /etc/systemd/system/swarm-agent.service
fi
diff --git a/magnum/templates/swarm/fragments/write-heat-params.yaml b/magnum/templates/swarm/fragments/write-heat-params.yaml
index 9a7a58c..2a01d60 100644
--- a/magnum/templates/swarm/fragments/write-heat-params.yaml
+++ b/magnum/templates/swarm/fragments/write-heat-params.yaml
@@ -15,3 +15,5 @@ write_files:
USER_TOKEN="$USER_TOKEN"
MAGNUM_URL="$MAGNUM_URL"
TLS_DISABLED="$TLS_DISABLED"
+ SWARM_IMAGE_NAME="swarm"
+ SWARM_IMAGE_VERSION="1.0.0"