Cleanup template formatting
This patch is meant to cleanup indentations in the templates, as well some other house keeping fixes. Closes-Bug: #1504685 Change-Id: I43f6cca8f449dea2db4de6a5308bfa5e4551838e
This commit is contained in:
parent
8f84055caf
commit
485d9a9018
|
@ -7,8 +7,8 @@ if [ "$HTTP_PROXY" != "" ]; then
|
|||
[Service]
|
||||
Environment=HTTP_PROXY=$HTTP_PROXY
|
||||
EOF
|
||||
systemctl daemon-reload
|
||||
systemctl --no-block restart docker.service
|
||||
systemctl daemon-reload
|
||||
systemctl --no-block restart docker.service
|
||||
if [ -f "/etc/bashrc" ]; then
|
||||
cat >> /etc/bashrc <<EOF
|
||||
declare -x http_proxy=$HTTP_PROXY
|
||||
|
@ -24,7 +24,7 @@ if [ "$HTTPS_PROXY" != "" ]; then
|
|||
declare -x https_proxy=$HTTPS_PROXY
|
||||
EOF
|
||||
else
|
||||
echo "File /etc/bashrc does not exists, not setting https_proxy"
|
||||
echo "File /etc/bashrc does not exists, not setting https_proxy"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -37,7 +37,7 @@ EOF
|
|||
cat>> /etc/bashrc <<EOF
|
||||
declare -x no_proxy=$SWARM_MASTER_IP,$SWARM_NODE_IP
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "File /etc/bashrc does not exists, not setting no_proxy"
|
||||
fi
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo starting services
|
||||
echo "starting services"
|
||||
systemctl daemon-reload
|
||||
for service in $NODE_SERVICES; do
|
||||
echo "activating service $service"
|
||||
systemctl enable $service
|
||||
systemctl --no-block start $service
|
||||
echo "activating service $service"
|
||||
systemctl enable $service
|
||||
systemctl --no-block start $service
|
||||
done
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo removing docker key
|
||||
echo "removing docker key"
|
||||
rm -f /etc/docker/key.json
|
||||
|
|
|
@ -23,4 +23,3 @@ vgcreate docker $DOCKER_DEV
|
|||
cat > /etc/sysconfig/docker-storage-setup <<EOF
|
||||
VG=docker
|
||||
EOF
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
|
||||
|
||||
if [ "$FLANNEL_USE_VXLAN" == "true" ]; then
|
||||
use_vxlan=1
|
||||
use_vxlan=1
|
||||
fi
|
||||
|
||||
# Generate a flannel configuration that we will
|
||||
|
@ -18,7 +18,7 @@ cat > $FLANNEL_JSON <<EOF
|
|||
EOF
|
||||
|
||||
if [ "$use_vxlan" = 1 ]; then
|
||||
cat >> $FLANNEL_JSON <<EOF
|
||||
cat >> $FLANNEL_JSON <<EOF
|
||||
,
|
||||
"Backend": {
|
||||
"Type": "vxlan"
|
||||
|
@ -32,8 +32,8 @@ EOF
|
|||
|
||||
# wait for etcd to become active (we will need it to push the flanneld config)
|
||||
while ! curl -sf -o /dev/null $FLANNEL_ETCD/v2/keys/; do
|
||||
echo "waiting for etcd"
|
||||
sleep 1
|
||||
echo "waiting for etcd"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# put the flannel config in etcd
|
||||
|
@ -41,4 +41,3 @@ echo "creating flanneld config in etcd"
|
|||
curl -sf -L $FLANNEL_ETCD/v2/keys/coreos.com/network/config \
|
||||
-X PUT \
|
||||
--data-urlencode value@/etc/sysconfig/flannel-network.json
|
||||
|
||||
|
|
|
@ -13,14 +13,14 @@ sed -i '
|
|||
|
||||
KUBE_API_ARGS="--runtime_config=api/all=true"
|
||||
if [ "$TLS_DISABLED" == "True" ]; then
|
||||
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0 --insecure-port=$KUBE_API_PORT"
|
||||
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0 --insecure-port=$KUBE_API_PORT"
|
||||
else
|
||||
KUBE_API_ADDRESS="--bind_address=0.0.0.0 --secure-port=$KUBE_API_PORT"
|
||||
# insecure port is used internaly
|
||||
KUBE_API_ADDRESS="$KUBE_API_ADDRESS --insecure-port=8080"
|
||||
KUBE_API_ARGS="$KUBE_API_ARGS --tls_cert_file=/srv/kubernetes/server.crt"
|
||||
KUBE_API_ARGS="$KUBE_API_ARGS --tls_private_key_file=/srv/kubernetes/server.key"
|
||||
KUBE_API_ARGS="$KUBE_API_ARGS --client_ca_file=/srv/kubernetes/ca.crt"
|
||||
KUBE_API_ADDRESS="--bind_address=0.0.0.0 --secure-port=$KUBE_API_PORT"
|
||||
# insecure port is used internaly
|
||||
KUBE_API_ADDRESS="$KUBE_API_ADDRESS --insecure-port=8080"
|
||||
KUBE_API_ARGS="$KUBE_API_ARGS --tls_cert_file=/srv/kubernetes/server.crt"
|
||||
KUBE_API_ARGS="$KUBE_API_ARGS --tls_private_key_file=/srv/kubernetes/server.key"
|
||||
KUBE_API_ARGS="$KUBE_API_ARGS --client_ca_file=/srv/kubernetes/ca.crt"
|
||||
fi
|
||||
|
||||
sed -i '
|
||||
|
|
|
@ -15,26 +15,26 @@ fi
|
|||
KUBE_MASTER_URI="$KUBE_PROTOCOL://$KUBE_MASTER_IP:$KUBE_API_PORT"
|
||||
|
||||
sed -i '
|
||||
/^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
|
||||
/^KUBE_ETCD_SERVERS=/ s|=.*|="--etcd_servers=http://'"$ETCD_SERVER_IP"':2379"|
|
||||
/^KUBE_MASTER=/ s|=.*|="--master='"$KUBE_MASTER_URI"'"|
|
||||
/^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
|
||||
/^KUBE_ETCD_SERVERS=/ s|=.*|="--etcd_servers=http://'"$ETCD_SERVER_IP"':2379"|
|
||||
/^KUBE_MASTER=/ s|=.*|="--master='"$KUBE_MASTER_URI"'"|
|
||||
' /etc/kubernetes/config
|
||||
|
||||
sed -i '
|
||||
/^KUBELET_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
|
||||
/^KUBELET_HOSTNAME=/ s/=.*/=""/
|
||||
/^KUBELET_API_SERVER=/ s|=.*|="--api_servers='"$KUBE_MASTER_URI"'"|
|
||||
/^KUBELET_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
||||
/^KUBELET_ADDRESS=/ s/=.*/="--address=0.0.0.0"/
|
||||
/^KUBELET_HOSTNAME=/ s/=.*/=""/
|
||||
/^KUBELET_API_SERVER=/ s|=.*|="--api_servers='"$KUBE_MASTER_URI"'"|
|
||||
/^KUBELET_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
||||
' /etc/kubernetes/kubelet
|
||||
|
||||
sed -i '
|
||||
/^KUBE_PROXY_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
||||
/^KUBE_PROXY_ARGS=/ s|=.*|='"$KUBE_CONFIG"'|
|
||||
' /etc/kubernetes/proxy
|
||||
|
||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
||||
sed -i '
|
||||
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':2379"|
|
||||
' /etc/sysconfig/flanneld
|
||||
sed -i '
|
||||
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':2379"|
|
||||
' /etc/sysconfig/flanneld
|
||||
fi
|
||||
|
||||
cat >> /etc/environment <<EOF
|
||||
|
|
|
@ -6,7 +6,7 @@ if [ "$REGISTRY_ENABLED" = "False" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
echo starting docker registry ...
|
||||
echo "starting docker registry ..."
|
||||
systemctl daemon-reload
|
||||
systemctl enable registry
|
||||
systemctl --no-block start registry
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo starting etcd
|
||||
echo "starting etcd"
|
||||
systemctl enable etcd
|
||||
systemctl --no-block start etcd
|
||||
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
# make sure we pick up any modified unit files
|
||||
systemctl daemon-reload
|
||||
|
||||
echo starting services
|
||||
echo "starting services"
|
||||
for service in etcd kube-apiserver kube-scheduler kube-controller-manager; do
|
||||
echo "activating service $service"
|
||||
systemctl enable $service
|
||||
systemctl --no-block start $service
|
||||
echo "activating service $service"
|
||||
systemctl enable $service
|
||||
systemctl --no-block start $service
|
||||
done
|
||||
|
||||
|
||||
|
|
|
@ -15,4 +15,3 @@ for service in docker kubelet kube-proxy; do
|
|||
systemctl enable $service
|
||||
systemctl --no-block start $service
|
||||
done
|
||||
|
||||
|
|
|
@ -7,4 +7,3 @@ system_info:
|
|||
groups: [wheel, adm, systemd-journal]
|
||||
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
||||
shell: /bin/bash
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ set -o pipefail
|
|||
. /etc/sysconfig/heat-params
|
||||
|
||||
if [ "$TLS_DISABLED" == "True" ]; then
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cert_dir=/srv/kubernetes
|
||||
|
@ -38,8 +38,8 @@ CLIENT_KEY=$cert_dir/client.key
|
|||
|
||||
# Get CA certificate for this bay
|
||||
curl -X GET \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > $CA_CERT
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > $CA_CERT
|
||||
|
||||
# Create config for client's csr
|
||||
cat > ${cert_conf_dir}/client.conf <<EOF
|
||||
|
@ -76,7 +76,7 @@ curl -X POST \
|
|||
$MAGNUM_URL/certificates | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CLIENT_CERT}
|
||||
|
||||
sed -i '
|
||||
s|CA_CERT|'"$CA_CERT"'|
|
||||
s|CLIENT_CERT|'"$CLIENT_CERT"'|
|
||||
s|CLIENT_KEY|'"$CLIENT_KEY"'|
|
||||
s|CA_CERT|'"$CA_CERT"'|
|
||||
s|CLIENT_CERT|'"$CLIENT_CERT"'|
|
||||
s|CLIENT_KEY|'"$CLIENT_KEY"'|
|
||||
' /srv/kubernetes/kubeconfig.yaml
|
||||
|
|
|
@ -45,8 +45,8 @@ SERVER_KEY=$cert_dir/server.key
|
|||
|
||||
# Get CA certificate for this bay
|
||||
curl -X GET \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CA_CERT}
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
$MAGNUM_URL/certificates/$BAY_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CA_CERT}
|
||||
|
||||
# Create config for server's csr
|
||||
cat > ${cert_conf_dir}/server.conf <<EOF
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
||||
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. /etc/sysconfig/flanneld
|
||||
|
||||
|
@ -54,4 +56,3 @@ chmod 0644 $FLANNEL_CONFIG_SERVICE
|
|||
|
||||
systemctl enable flannel-config
|
||||
systemctl start --no-block flannel-config
|
||||
fi # end if [ "$NETWORK_DRIVER" == "flannel" ]
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
||||
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
FLANNEL_DOCKER_BRIDGE_BIN=/usr/local/bin/flannel-docker-bridge
|
||||
FLANNEL_DOCKER_BRIDGE_SERVICE=/etc/systemd/system/flannel-docker-bridge.service
|
||||
|
@ -73,5 +75,3 @@ chmod 0644 $FLANNEL_DOCKER_BRIDGE_CONF
|
|||
echo "activating service flanneld"
|
||||
systemctl enable flanneld
|
||||
systemctl --no-block start flanneld
|
||||
|
||||
fi
|
||||
|
|
|
@ -19,4 +19,3 @@ monitor-delay=1m
|
|||
monitor-timeout=30s
|
||||
monitor-max-retries=3
|
||||
EOF
|
||||
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
. /etc/sysconfig/heat-params
|
||||
|
||||
if [ "$NETWORK_DRIVER" == "flannel" ]; then
|
||||
if [ "$NETWORK_DRIVER" != "flannel" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. /etc/sysconfig/flanneld
|
||||
|
||||
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
|
||||
|
@ -12,11 +15,11 @@ FLANNEL_NETWORK_SUBNETLEN="$FLANNEL_NETWORK_SUBNETLEN"
|
|||
FLANNEL_USE_VXLAN="$FLANNEL_USE_VXLAN"
|
||||
|
||||
sed -i '
|
||||
/^FLANNEL_ETCD=/ s/=.*/="http:\/\/127.0.0.1:2379"/
|
||||
/^FLANNEL_ETCD=/ s/=.*/="http:\/\/127.0.0.1:2379"/
|
||||
' /etc/sysconfig/flanneld
|
||||
|
||||
if [ "$FLANNEL_USE_VXLAN" == "true" ]; then
|
||||
use_vxlan=1
|
||||
use_vxlan=1
|
||||
fi
|
||||
|
||||
# Generate a flannel configuration that we will
|
||||
|
@ -28,7 +31,7 @@ cat > $FLANNEL_JSON <<EOF
|
|||
EOF
|
||||
|
||||
if [ "$use_vxlan" = 1 ]; then
|
||||
cat >> $FLANNEL_JSON <<EOF
|
||||
cat >> $FLANNEL_JSON <<EOF
|
||||
,
|
||||
"Backend": {
|
||||
"Type": "vxlan"
|
||||
|
@ -39,5 +42,3 @@ fi
|
|||
cat >> $FLANNEL_JSON <<EOF
|
||||
}
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
|
|
@ -20,4 +20,6 @@ echo "$myip" > /etc/mesos-slave/ip
|
|||
echo "docker,mesos" > /etc/mesos-slave/containerizers
|
||||
|
||||
# Amount of time to wait for an executor to register
|
||||
echo "$EXECUTOR_REGISTRATION_TIMEOUT" > /etc/mesos-slave/executor_registration_timeout
|
||||
cat > /etc/mesos-slave/executor_registration_timeout <<EOF
|
||||
$EXECUTOR_REGISTRATION_TIMEOUT
|
||||
EOF
|
||||
|
|
Loading…
Reference in New Issue