From fbd13b4120d7278e70b60b1803ee6c8ccdecdd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20=C3=81lvaro?= Date: Wed, 19 Dec 2018 22:23:03 +0100 Subject: [PATCH] Update documentation Issue #9 --- Makefile | 3 ++- README.md | 21 ++++++++++++--------- docker-compose.yml | 3 ++- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index a320ed5..d979070 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,8 @@ quickstart: --publish=4505:4505/tcp --publish=4506:4506/tcp \ --env "USERMAP_UID=$(shell id -u)" --env "USERMAP_GID=$(shell id -g)" \ --env SALT_LOG_LEVEL=info \ - --volume $(shell pwd)/srv/:/home/salt/data/srv/ \ + --volume $(shell pwd)/recipes/:/home/salt/data/srv/ \ + --volume $(shell pwd)/keys/:/home/salt/data/keys/ \ --volume $(shell pwd)/logs/:/home/salt/data/logs/ \ cdalvaro/saltstack-master:latest @echo "Type 'make logs' for the logs" diff --git a/README.md b/README.md index 64d6bfe..a60079b 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ Alternatively, you can manually launch the `saltstack-master` container: docker run --name salt_master --detach \ --publish 4505:4505/tcp --publish 4506:4506/tcp \ --env 'SALT_LOG_LEVEL=info' \ - --read-only --volume $(pwd)/srv/:/home/salt/data/srv/ \ + --volume $(pwd)/recipes/:/home/salt/data/srv/ \ + --volume $(pwd)/keys/:/home/salt/data/keys/ \ cdalvaro/saltstack-master:2018.3.3 ``` @@ -73,13 +74,13 @@ docker run --name salt_master --detach \ ### Custom Recipes -This image does not require storing data out of the container. - -But it is necessary to mount the `/srv/` volume ir order to provide your custom recipes. +In order to provide salt with your custom recipes you must mount the volume `/home/salt/data/srv/` with your recipes directory. ### Minion Keys -Minion keys can be added automatically on startup to SaltStack master by mounting the volume `/home/salt/data/keys` and copying the minion keys inside `keys/minions/` directory: +Minion keys can be added automatically on startup to SaltStack master by mounting the volume `/home/salt/data/keys` and copying the minion keys inside `keys/minions/` directory. + +It is also important to know that, in order to keep your keys after removing the container, the keys directory must be mounted. ```sh mkdir -p keys/minions @@ -88,7 +89,7 @@ rsync root@minion1:/etc/salt/pki/minion/minion.pub keys/minions/minion1 docker run --name salt_master -d \ --publish 4505:4505/tcp --publish 4506:4506/tcp \ --env 'SALT_LOG_LEVEL=info' \ - --volume $(pwd)/srv/:/home/salt/data/srv/ \ + --volume $(pwd)/recipes/:/home/salt/data/srv/ \ --volume $(pwd)/keys/:/home/salt/data/keys/ \ cdalvaro/saltstack-master:2018.3.3 ``` @@ -102,7 +103,7 @@ docker run --name salt_stack --detach \ --publish 4505:4505/tcp --publish 4506:4506/tcp \ --env 'SALT_LOG_LEVEL=info' \ --env 'SALT_MASTER_SIGN_PUBKEY=True' - --volume $(pwd)/srv/:/home/salt/data/srv/ \ + --volume $(pwd)/recipes/:/home/salt/data/srv/ \ --volume $(pwd)/keys/:/home/salt/data/keys/ \ cdalvaro/saltstack-master:2018.3.3 ``` @@ -128,7 +129,8 @@ Also the container processes seem to be executed as the host's user/group `1000` ```sh docker run --name salt_stack -it --rm \ --env "USERMAP_UID=$(id -u)" --env "USERMAP_GID=$(id -g)" \ - --volume $(pwd)/srv/:/home/salt/data/srv/ \ + --volume $(pwd)/recipes/:/home/salt/data/srv/ \ + --volume $(pwd)/keys/:/home/salt/data/keys/ \ cdalvaro/saltstack-master:2018.3.3 ``` @@ -226,7 +228,8 @@ EOF docker run --name salt_master -d \ --publish 3505:3505/tcp --publish 3506:3506/tcp \ --env 'SALT_LOG_LEVEL=info' \ - --read-only --volume $(pwd)/srv/:/home/salt/data/srv/ \ + --volume $(pwd)/recipes/:/home/salt/data/srv/ \ + --volume $(pwd)/keys/:/home/salt/data/keys/ \ --volume $(pwd)/config/:/home/salt/data/config/ \ cdalvaro/saltstack-master:2018.3.3 ``` diff --git a/docker-compose.yml b/docker-compose.yml index 8c645ff..944ee3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,8 @@ services: image: cdalvaro/saltstack-master:2018.3.3 restart: always volumes: - - "srv/:/home/salt/data/srv" + - "recipes/:/home/salt/data/srv" + - "keys/:/home/salt/data/keys" - "logs/:/home/salt/data/logs" ports: - "4505:4505/tcp"