summaryrefslogtreecommitdiffstats
path: root/mcp/scripts/docker-compose
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/scripts/docker-compose')
-rw-r--r--mcp/scripts/docker-compose/docker-compose.yaml.j21
-rwxr-xr-xmcp/scripts/docker-compose/files/entrypoint.sh10
-rw-r--r--mcp/scripts/docker-compose/files/opnfv_master.conf16
3 files changed, 27 insertions, 0 deletions
diff --git a/mcp/scripts/docker-compose/docker-compose.yaml.j2 b/mcp/scripts/docker-compose/docker-compose.yaml.j2
index 5ee96a1fc..54315978e 100644
--- a/mcp/scripts/docker-compose/docker-compose.yaml.j2
+++ b/mcp/scripts/docker-compose/docker-compose.yaml.j2
@@ -25,6 +25,7 @@ services:
- {{ conf.MCP_STORAGE_DIR }}/pod_config.yml:/root/pod_config.yml
- {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
- {{ conf.MCP_STORAGE_DIR }}/nodes:/srv/salt/reclass/nodes
+ - {{ conf.MCP_STORAGE_DIR }}/pki:/etc/pki
- {{ conf.MCP_STORAGE_DIR }}/salt:/etc/salt
- {{ conf.MCP_STORAGE_DIR }}/hosts:/etc/hosts
hostname: cfg01
diff --git a/mcp/scripts/docker-compose/files/entrypoint.sh b/mcp/scripts/docker-compose/files/entrypoint.sh
index 08c17a2e6..c7f7f9118 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.
diff --git a/mcp/scripts/docker-compose/files/opnfv_master.conf b/mcp/scripts/docker-compose/files/opnfv_master.conf
new file mode 100644
index 000000000..7066f04bf
--- /dev/null
+++ b/mcp/scripts/docker-compose/files/opnfv_master.conf
@@ -0,0 +1,16 @@
+file_roots:
+ base:
+ - /srv/salt/env/prd
+ prd:
+ - /srv/salt/env/prd
+ dev:
+ - /srv/salt/env/dev
+ - /srv/salt/env/prd
+
+user: root
+file_recv: True
+
+open_mode: True
+
+peer:
+ .*: ['x509.sign_remote_certificate']