summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-08-25 15:15:13 +0000
committerGerrit Code Review <review@openstack.org>2017-08-25 15:15:13 +0000
commitfed947d4000119866e66c3dd77463aa8823efb29 (patch)
treedc5c52cd9e3199a2a1c1c301956281b602935556
parent8d936de12200f8e4eb4f98b0896d39ae95ad79b3 (diff)
parent464186b7fa85905c2d27c798b3d05c15f292c064 (diff)
Merge "Fix no_proxy evaluation for Swarm clusters" into stable/pike5.0.1
-rw-r--r--magnum/drivers/common/templates/swarm/fragments/add-proxy.sh33
-rw-r--r--magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh4
-rw-r--r--magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh4
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml17
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml15
5 files changed, 40 insertions, 33 deletions
diff --git a/magnum/drivers/common/templates/swarm/fragments/add-proxy.sh b/magnum/drivers/common/templates/swarm/fragments/add-proxy.sh
index 1005bd9..6998a18 100644
--- a/magnum/drivers/common/templates/swarm/fragments/add-proxy.sh
+++ b/magnum/drivers/common/templates/swarm/fragments/add-proxy.sh
@@ -44,31 +44,20 @@ EOF
44 fi 44 fi
45fi 45fi
46 46
47if [ -n "$NO_PROXY" ]; then 47if [ -n "$HTTP_PROXY" -o -n "$HTTPS_PROXY" ]; then
48 cat <<EOF | sed "s/^ *//" > $DOCKER_NO_PROXY_CONF 48 if [ -n "$NO_PROXY" ]; then
49 [Service] 49 cat <<EOF | sed "s/^ *//" > $DOCKER_NO_PROXY_CONF
50 Environment=NO_PROXY=$NO_PROXY 50 [Service]
51EOF 51 Environment=NO_PROXY=$NO_PROXY
52
53 DOCKER_RESTART=1
54
55 if [ -f "$BASH_RC" ]; then
56 echo "declare -x no_proxy=$NO_PROXY" >> $BASH_RC
57 else
58 echo "File $BASH_RC does not exist, not setting no_proxy"
59 fi
60else
61 cat <<EOF | sed "s/^ *//" > $DOCKER_NO_PROXY_CONF
62 [Service]
63 Environment=NO_PROXY=$SWARM_API_IP,$ETCD_SERVER_IP,$SWARM_NODE_IP
64EOF 52EOF
65 53
66 DOCKER_RESTART=1 54 DOCKER_RESTART=1
67 55
68 if [ -f "$BASH_RC" ]; then 56 if [ -f "$BASH_RC" ]; then
69 echo "declare -x no_proxy=$SWARM_API_IP,$ETCD_SERVER_IP,$SWARM_NODE_IP" >> $BASH_RC 57 echo "declare -x no_proxy=$NO_PROXY" >> $BASH_RC
70 else 58 else
71 echo "File $BASH_RC does not exist, not setting no_proxy" 59 echo "File $BASH_RC does not exist, not setting no_proxy"
60 fi
72 fi 61 fi
73fi 62fi
74 63
diff --git a/magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh b/magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh
index 8e4ea82..d9d2b73 100644
--- a/magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh
+++ b/magnum/drivers/common/templates/swarm/fragments/write-swarm-agent-service.sh
@@ -16,10 +16,6 @@ if [ $TLS_DISABLED = 'True' ]; then
16 ETCDCTL_OPTIONS="" 16 ETCDCTL_OPTIONS=""
17fi 17fi
18 18
19if [ -z "$NO_PROXY" ]; then
20 NO_PROXY=$SWARM_API_IP,$ETCD_SERVER_IP,$SWARM_NODE_IP
21fi
22
23cat > $CONF_FILE << EOF 19cat > $CONF_FILE << EOF
24[Unit] 20[Unit]
25Description=Swarm Agent 21Description=Swarm Agent
diff --git a/magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh b/magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh
index 8f4187a..3976943 100644
--- a/magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh
+++ b/magnum/drivers/common/templates/swarm/fragments/write-swarm-master-service.sh
@@ -2,10 +2,6 @@
2 2
3CERT_DIR=/etc/docker 3CERT_DIR=/etc/docker
4 4
5if [ -z "$NO_PROXY" ]; then
6 NO_PROXY=$SWARM_API_IP,$ETCD_SERVER_IP,$SWARM_NODE_IP
7fi
8
9cat > /etc/systemd/system/swarm-manager.service << END_SERVICE_TOP 5cat > /etc/systemd/system/swarm-manager.service << END_SERVICE_TOP
10[Unit] 6[Unit]
11Description=Swarm Manager 7Description=Swarm Manager
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml
index c319afb..2385b0b 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml
@@ -205,6 +205,19 @@ resources:
205 # software configs. these are components that are combined into 205 # software configs. these are components that are combined into
206 # a multipart MIME user-data archive. 206 # a multipart MIME user-data archive.
207 # 207 #
208 no_proxy_extended:
209 type: OS::Heat::Value
210 properties:
211 type: string
212 value:
213 list_join:
214 - ','
215 - - {get_attr: [api_address_switch, private_ip]}
216 - {get_attr: [swarm_master_eth0, fixed_ips, 0, ip_address]}
217 - {get_attr: [etcd_address_switch, private_ip]}
218 - {get_attr: [api_address_switch, public_ip]}
219 - {get_param: no_proxy}
220
208 write_heat_params: 221 write_heat_params:
209 type: "OS::Heat::SoftwareConfig" 222 type: "OS::Heat::SoftwareConfig"
210 properties: 223 properties:
@@ -220,7 +233,7 @@ resources:
220 "$ETCD_DISCOVERY_URL": {get_param: discovery_url} 233 "$ETCD_DISCOVERY_URL": {get_param: discovery_url}
221 "$HTTP_PROXY": {get_param: http_proxy} 234 "$HTTP_PROXY": {get_param: http_proxy}
222 "$HTTPS_PROXY": {get_param: https_proxy} 235 "$HTTPS_PROXY": {get_param: https_proxy}
223 "$NO_PROXY": {get_param: no_proxy} 236 "$NO_PROXY": {get_attr: [no_proxy_extended, value]}
224 "$SWARM_API_IP": {get_attr: [api_address_switch, private_ip]} 237 "$SWARM_API_IP": {get_attr: [api_address_switch, private_ip]}
225 "$SWARM_NODE_IP": {get_attr: [swarm_master_eth0, fixed_ips, 0, ip_address]} 238 "$SWARM_NODE_IP": {get_attr: [swarm_master_eth0, fixed_ips, 0, ip_address]}
226 "$CLUSTER_UUID": {get_param: cluster_uuid} 239 "$CLUSTER_UUID": {get_param: cluster_uuid}
@@ -322,7 +335,7 @@ resources:
322 "$WAIT_CURL": {get_attr: [master_wait_handle, curl_cli]} 335 "$WAIT_CURL": {get_attr: [master_wait_handle, curl_cli]}
323 "$HTTP_PROXY": {get_param: http_proxy} 336 "$HTTP_PROXY": {get_param: http_proxy}
324 "$HTTPS_PROXY": {get_param: https_proxy} 337 "$HTTPS_PROXY": {get_param: https_proxy}
325 "$NO_PROXY": {get_param: no_proxy} 338 "$NO_PROXY": {get_attr: [no_proxy_extended, value]}
326 "$TLS_DISABLED": {get_param: tls_disabled} 339 "$TLS_DISABLED": {get_param: tls_disabled}
327 "$SWARM_VERSION": {get_param: swarm_version} 340 "$SWARM_VERSION": {get_param: swarm_version}
328 "$SWARM_STRATEGY": {get_param: swarm_strategy} 341 "$SWARM_STRATEGY": {get_param: swarm_strategy}
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml
index 2acdab2..594014c 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml
@@ -183,6 +183,19 @@ resources:
183 # 183 #
184 # software configs. these are components that are combined into 184 # software configs. these are components that are combined into
185 # a multipart MIME user-data archive. 185 # a multipart MIME user-data archive.
186 no_proxy_extended:
187 type: OS::Heat::Value
188 properties:
189 type: string
190 value:
191 list_join:
192 - ','
193 - - {get_param: swarm_api_ip}
194 - {get_attr: [swarm_node_eth0, fixed_ips, 0, ip_address]}
195 - {get_param: etcd_server_ip}
196 - {get_param: api_ip_address}
197 - {get_param: no_proxy}
198
186 write_heat_params: 199 write_heat_params:
187 type: "OS::Heat::SoftwareConfig" 200 type: "OS::Heat::SoftwareConfig"
188 properties: 201 properties:
@@ -197,7 +210,7 @@ resources:
197 "$DOCKER_STORAGE_DRIVER": {get_param: docker_storage_driver} 210 "$DOCKER_STORAGE_DRIVER": {get_param: docker_storage_driver}
198 "$HTTP_PROXY": {get_param: http_proxy} 211 "$HTTP_PROXY": {get_param: http_proxy}
199 "$HTTPS_PROXY": {get_param: https_proxy} 212 "$HTTPS_PROXY": {get_param: https_proxy}
200 "$NO_PROXY": {get_param: no_proxy} 213 "$NO_PROXY": {get_attr: [no_proxy_extended, value]}
201 "$SWARM_API_IP": {get_param: swarm_api_ip} 214 "$SWARM_API_IP": {get_param: swarm_api_ip}
202 "$SWARM_NODE_IP": {get_attr: [swarm_node_eth0, fixed_ips, 0, ip_address]} 215 "$SWARM_NODE_IP": {get_attr: [swarm_node_eth0, fixed_ips, 0, ip_address]}
203 "$CLUSTER_UUID": {get_param: cluster_uuid} 216 "$CLUSTER_UUID": {get_param: cluster_uuid}