X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=mcp%2Fscripts%2Fdocker-compose%2Ffiles%2Fentrypoint.sh;h=9bf3cfc3f05baffd3e92fc3fb817f8ec1d8e3d97;hb=6272bd42dcac3ea9b9848d5487dbf2eff08ae0f8;hp=08c17a2e66a29327ff48485bfefe49332b119610;hpb=b0a8b088bcf73302b5fa4d30c8fad6a1612938d5;p=fuel.git diff --git a/mcp/scripts/docker-compose/files/entrypoint.sh b/mcp/scripts/docker-compose/files/entrypoint.sh index 08c17a2e6..9bf3cfc3f 100755 --- a/mcp/scripts/docker-compose/files/entrypoint.sh +++ b/mcp/scripts/docker-compose/files/entrypoint.sh @@ -18,6 +18,16 @@ if [ ! -f /home/ubuntu/.ssh/authorized_keys ]; then /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 +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 + # NOTE: Most Salt and/or reclass tools have issues traversing Docker mounts # or detecting them as directories inside the container. # For now, let's do a lot of copy operations to bypass this. @@ -33,7 +43,7 @@ cp -a /root/pod_config.yml \ prefix=/srv/salt/formula/salt-formulas rm -f /root/fuel/mcp/salt-formulas/*/.git cp -ar /root/fuel/mcp/salt-formulas/* ${prefix}/ -for formula in 'armband' 'opendaylight' 'tacker'; do +for formula in 'armband' 'opendaylight' 'tacker' 'quagga'; do ln -sf /root/fuel/mcp/salt-formulas/salt-formula-${formula}/* \ /srv/salt/env/prd/ done @@ -68,7 +78,7 @@ sed -i -e "s|return 'start/running' in |return 'is running' in |" \ find -L /srv/salt /srv/salt/env/prd/_* -maxdepth 1 -type l -delete # Fix up any permissions after above file shuffling -sudo chown root:root -R /srv/salt +chown root:root -R /srv/salt service ssh start service salt-minion start