Use heat-params in systemd unit
Instead of sourcing heat-params in script, we can use it as a systemd unit EnvironmentFile directive and not inline in sh scripts. Change-Id: I3ebf23dee6785febdc87bc5ce4212c30ef24806e
This commit is contained in:
parent
25aa5b06ff
commit
220675d42a
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/add-proxy.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,8 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
DOCKER_HTTP_PROXY_CONF=/etc/systemd/system/docker.service.d/http_proxy.conf
|
||||
|
||||
DOCKER_HTTPS_PROXY_CONF=/etc/systemd/system/docker.service.d/https_proxy.conf
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/configure-etcd.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
DROP_IN_FILE=/etc/systemd/system/etcd2.service.d/20-configure-etcd.conf
|
||||
|
|
|
@ -11,6 +11,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/create-kube-namespace.sh
|
||||
|
||||
[Install]
|
||||
|
@ -22,7 +23,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
until curl -sf "http://127.0.0.1:8080/healthz"
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kube-apiserver.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
KUBE_CERTS_PATH=/etc/kubernetes/ssl
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kube-controller-manager.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,8 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
KUBE_CERTS_PATH=/etc/kubernetes/ssl
|
||||
HOST_CERTS_PATH=/usr/share/ca-certificates
|
||||
SYSCONFIG_PATH=/etc/sysconfig
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kube-proxy-master.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,10 +21,8 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
|
||||
HOST_CERTS_PATH=/usr/share/ca-certificates
|
||||
|
||||
TEMPLATE=/etc/kubernetes/manifests/kube-proxy.yaml
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kube-proxy-minion.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
KUBE_CERTS_PATH=/etc/kubernetes/ssl
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kube-scheduler.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,8 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
TEMPLATE=/etc/kubernetes/manifests/kube-scheduler.yaml
|
||||
mkdir -p $(dirname ${TEMPLATE})
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kubelet-master.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
CONF_FILE=/etc/systemd/system/kubelet.service
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-kubelet-minion.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
myip=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
|
||||
|
||||
KUBE_CERTS_PATH=/etc/kubernetes/ssl
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-network-service.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/enable-network-service.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/make-cert.sh
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/make-cert.sh
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/wc-notify.sh
|
||||
|
||||
[Install]
|
||||
|
@ -19,6 +20,5 @@ write_files:
|
|||
permissions: "0755"
|
||||
content: |
|
||||
#!/bin/bash -v
|
||||
. /etc/sysconfig/heat-params
|
||||
command="$WAIT_CURL --data-binary '{\"status\": \"SUCCESS\"}'"
|
||||
eval $(echo "$command")
|
||||
|
|
|
@ -9,6 +9,7 @@ write_files:
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/sysconfig/heat-params
|
||||
ExecStart=/etc/sysconfig/write-network-config.sh
|
||||
|
||||
[Install]
|
||||
|
@ -20,7 +21,6 @@ write_files:
|
|||
content: |
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/sysconfig/heat-params
|
||||
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue