[cfg01] Use ssh config to set default user & key
[fuel.git] / mcp / scripts / docker-compose / files / entrypoint.sh
index 9bf3cfc..9830ea1 100755 (executable)
@@ -16,6 +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
+    mkdir -p /root/.ssh/
+    echo 'User ubuntu' > /root/.ssh/config
+    echo 'IdentityFile /root/fuel/mcp/scripts/mcp.rsa' >> /root/.ssh/config
 fi
 
 if ! grep -q localhost /etc/hosts; then
@@ -69,11 +72,22 @@ 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|" \
     /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