[baremetal] Containerize MaaS
[fuel.git] / mcp / scripts / docker-compose / files / entrypoint.sh
index 0199c39..a0f72e2 100755 (executable)
@@ -16,11 +16,9 @@ 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
@@ -69,6 +67,13 @@ for formula in /usr/share/salt-formulas/reclass/service/*; do
     ln -sf "${formula}" "/srv/salt/reclass/classes/service/$(basename ${formula})"
 done
 
+# Temporary link queens configs to rocky
+for f in /srv/salt/env/prd/*/files/queens; do
+    if [ ! -d "$f/../rocky" ]; then
+        ln -sf "$f" "$f/../rocky"
+    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|" \