Merge "Add odl bgpvpn noha scenario to fuel"
[fuel.git] / mcp / scripts / docker-compose / files / entrypoint.sh
index 08c17a2..9bf3cfc 100755 (executable)
@@ -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