aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/scripts/docker-compose/files/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/scripts/docker-compose/files/entrypoint.sh')
-rwxr-xr-xmcp/scripts/docker-compose/files/entrypoint.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/mcp/scripts/docker-compose/files/entrypoint.sh b/mcp/scripts/docker-compose/files/entrypoint.sh
index 9bf3cfc3f..baf1f65d2 100755
--- a/mcp/scripts/docker-compose/files/entrypoint.sh
+++ b/mcp/scripts/docker-compose/files/entrypoint.sh
@@ -16,17 +16,15 @@ fi
if [ ! -f /home/ubuntu/.ssh/authorized_keys ]; then
install -D -o ubuntu /root/fuel/mcp/scripts/mcp.rsa.pub \
/home/ubuntu/.ssh/authorized_keys
-fi
-
-if ! grep -q localhost /etc/hosts; then
- # overwrite hosts only on first container up, to preserve cluster nodes
- cp -a /root/fuel/mcp/scripts/docker-compose/files/hosts /etc/hosts
+ mkdir -p /root/.ssh/
+ echo 'User ubuntu' > /root/.ssh/config
+ echo 'IdentityFile /root/fuel/mcp/scripts/mcp.rsa' >> /root/.ssh/config
fi
# salt state does not properly configure file_roots in master.conf, hard set it
cp -a /root/fuel/mcp/scripts/docker-compose/files/opnfv_master.conf \
/etc/salt/master.d/opnfv_master.conf
-echo 'master: localhost' > /etc/salt/minion.d/opnfv_slave.conf
+echo -e 'master: localhost\nmine_interval: 15' > /etc/salt/minion.d/opnfv_slave.conf
# NOTE: Most Salt and/or reclass tools have issues traversing Docker mounts
# or detecting them as directories inside the container.
@@ -69,17 +67,33 @@ for formula in /usr/share/salt-formulas/reclass/service/*; do
ln -sf "${formula}" "/srv/salt/reclass/classes/service/$(basename ${formula})"
done
+# Temporary link rocky configs to stein
+for f in /srv/salt/env/prd/*/files/rocky; do
+ if [ ! -d "$f/../stein" ]; then
+ ln -sf "$f" "$f/../stein"
+ fi
+done
+
# Tini init system resembles upstart very much, but needs a little adjustment
sed -i -e "s|return 'start/running' in |return 'is running' in |" \
-e "s|ret = _default_runlevel|return _default_runlevel|" \
/usr/lib/python2.7/dist-packages/salt/modules/upstart.py
+# Workaround for: https://github.com/salt-formulas/reclass/issues/77
+sed -i -e 's|\(ignore_overwritten_missing_references\)defaults.|\1|' \
+ /usr/local/lib/python2.7/dist-packages/reclass/settings.py
+
# Remove broken symlinks in /srv/salt, silences recurring warnings
find -L /srv/salt /srv/salt/env/prd/_* -maxdepth 1 -type l -delete
# Fix up any permissions after above file shuffling
chown root:root -R /srv/salt
+# Docker-ce 19.x+ workaround for broken domainname setup
+# shellcheck source=/dev/null
+source /root/fuel/mcp/scripts/xdf_data.sh
+hostname -b "cfg01.${CLUSTER_DOMAIN}"
+
service ssh start
service salt-minion start