Skip to content

Commit

Permalink
doc: Update README.md files
Browse files Browse the repository at this point in the history
  • Loading branch information
cdalvaro committed Mar 20, 2024
1 parent 35c54d8 commit c8a2666
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The full log with the outputted error.

- Host OS: [e.g. `uname -a`]
- Docker: [e.g. `docker --version`]
- Image tag: [e.g. `3007.0_1`]
- Image tag: [e.g. `3007.0_2`]

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG VCS_REF

# https://github.com/saltstack/salt/releases
ENV SALT_VERSION="3007.0"
ENV IMAGE_REVISION="_1"
ENV IMAGE_REVISION="_2"
ENV IMAGE_VERSION="${SALT_VERSION}${IMAGE_REVISION}"

ENV SALT_DOCKER_DIR="/etc/docker-salt" \
Expand Down
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Automated builds of the image are available on
the recommended method of installation.

```sh
docker pull ghcr.io/cdalvaro/docker-salt-master:3007.0_1
docker pull ghcr.io/cdalvaro/docker-salt-master:3007.0_2
```

You can also pull the `latest` tag, which is built from the repository `HEAD`
Expand Down Expand Up @@ -375,6 +375,45 @@ Begin executing salt states with `pepper`:
pepper '*' test.ping
```

### Salt Minion

This image contains support for running a built-in `salt-minion` service.
You can enable it by setting the environment variable `SALT_MINION_ENABLED` to `True`.

The `salt-minion` will be automatically accepted by the master. Keys will be automatically configured,
even if `SALT_MASTER_SIGN_PUBKEY=True`.

However, minion keys can be provided via Docker secrets.
To do that, you have to set the env variable `SALT_MINION_KEY_FILE`,
pointing to the path inside the container of the minion-key-pair {pem,pub} files without extensions.

Minion's keys will be stored inside the `keys/SALT_MINION_ID/` directory.

This minion can be configured in the same way as the master.
You can add your custom configuration files inside a `minion_config/` directory
and mount it into `/home/salt/data/minion_config/`.

The default id of the minion is `builtin.minion`.
But you can change it by setting the environment variable `SALT_MINION_ID`.

Log levels are the same as the master,
and you can set them by using the `SALT_LOG_LEVEL` and `SALT_LEVEL_LOGFILE` environment variables.

Here you have an example of how to run a `salt-master` with a built-in `salt-minion`:

```sh
docker run --name salt_stack --detach \
--publish 4505:4505 --publish 4506:4506 \
--env 'SALT_MINION_ENABLED=True' \
--env 'SALT_MINION_ID=control-minion' \
--env 'SALT_MASTER_SIGN_PUBKEY=True' \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
--volume $(pwd)/config/:/home/salt/data/config/ \
--volume $(pwd)/minion_config/:/home/salt/data/minion_config/ \
ghcr.io/cdalvaro/docker-salt-master:latest
```

### Host Mapping

By default, the container is configured to run `salt-master` as user and group `salt` with `uid` and `gid` `1000`. From
Expand Down Expand Up @@ -738,6 +777,8 @@ installation.
| `SALT_API_USER_PASS_FILE` | `SALT_API_USER` password file path. Use this variable to set the path of a file containing the password for the `SALT_API_USER`. Useful to load the password from secrets. Has priority over `SALT_API_USER_PASS`. _Unset_ by default. |
| `SALT_API_USER_PASS` | `SALT_API_USER` password. Required if `SALT_API_SERVICE_ENBALED` is `True`, `SALT_API_USER` is not empty and `SALT_API_USER_PASS_FILE` is unset. _Unset_ by default. |
| `SALT_API_CERT_CN` | Common name in the request. Default: `localhost`. |
| `SALT_MINION_ENABLED` | Enable `salt-minion` service. Default: `False`. |
| `SALT_MINION_ID` | Set the id of the `salt-minion` service. Default: `builtin.minion`. |
| [`SALT_MASTER_SIGN_PUBKEY`](https://docs.saltproject.io/en/latest/ref/configuration/master.html#master-sign-pubkey) | Sign the master auth-replies with a cryptographic signature of the master's public key. Possible values: `True` or `False`. Default: `False`. |
| [`SALT_MASTER_USE_PUBKEY_SIGNATURE`](https://docs.saltproject.io/en/latest/ref/configuration/master.html#master-use-pubkey-signature) | Instead of computing the signature for each auth-reply, use a pre-calculated signature. This option requires `SALT_MASTER_SIGN_PUBKEY` set to `True`. Possible values: `True` or `False`. Default: `True`. |
| [`SALT_MASTER_SIGN_KEY_NAME`](https://docs.saltproject.io/en/latest/ref/configuration/master.html#master-sign-key-name) | The customizable name of the signing-key-pair without suffix. Default: `master_sign`. |
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ services:
# SALT_API_ENABLED: 'True'
# SALT_API_USER: salt_api
# SALT_API_USER_PASS: 4wesome-Pass0rd
### salt-minion settings
# SALT_MINION_ENABLED: 'True'
# SALT_MINION_ID: builtin.minion
43 changes: 42 additions & 1 deletion docs/es-ES/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Para otros métodos de instalación de `salt-master`, por favor consulta la [gu
Todas las imágenes están disponibles en el [Registro de Contenedores de GitHub](https://github.com/cdalvaro/docker-salt-master/pkgs/container/docker-salt-master) y es el método recomendado para la instalación.

```sh
docker pull ghcr.io/cdalvaro/docker-salt-master:3007.0_1
docker pull ghcr.io/cdalvaro/docker-salt-master:3007.0_2
```

También puedes obtener la imagen `latest`, que se construye a partir del repositorio `HEAD`.
Expand Down Expand Up @@ -348,6 +348,45 @@ Empieza ejecutando estados de Salt con `pepper`:
pepper '*' test.ping
```

### Salt Minion

Esta imagen contiene soporte para ejecutar un servicio `salt-minion` integrado.
Puedes habilitarlo estableciendo la variable de entorno `SALT_MINION_ENABLED` a `True`.

El `salt-minion` será aceptado automáticamente por el master.
Y las claves se configurarán automáticamente, incluso si `SALT_MASTER_SIGN_PUBKEY=True`.

Sin embargo, las claves del minion pueden proporcionarse a través de _secrets_ de Docker.
Para hacerlo, debes establecer la variable de entorno `SALT_MINION_KEY_FILE`,
apuntando a la ruta dentro del contenedor de los archivos del par de claves del minion {pem,pub} sin extensiones.

Las claves del minion se almacenarán en el directorio `keys/SALT_MINION_ID/`.

Este minion puede configurarse de la misma manera que el master.
Puedes añadir tus archivos de configuración personalizados dentro de un directorio `minion_config/`
y montarlo en `/home/salt/data/minion_config/`.

El id por defecto del minion es `builtin.minion`.
Pero puedes cambiarlo estableciendo la variable de entorno `SALT_MINION_ID`.

El nivel de los logs del minion es el mismo que el del master,
y puedes establecerlos usando las variables de entorno `SALT_LOG_LEVEL` y `SALT_LEVEL_LOGFILE`.

Aquí tienes un ejemplo de cómo ejecutar un `salt-master` con un `salt-minion` integrado:

```sh
docker run --name salt_stack --detach \
--publish 4505:4505 --publish 4506:4506 \
--env 'SALT_MINION_ENABLED=True' \
--env 'SALT_MINION_ID=control-minion' \
--env 'SALT_MASTER_SIGN_PUBKEY=True' \
--volume $(pwd)/roots/:/home/salt/data/srv/ \
--volume $(pwd)/keys/:/home/salt/data/keys/ \
--volume $(pwd)/config/:/home/salt/data/config/ \
--volume $(pwd)/minion_config/:/home/salt/data/minion_config/ \
ghcr.io/cdalvaro/docker-salt-master:latest
```

### Mapeo de Host

Por defecto, el contenedor está configurado para ejecutar `salt-master` como usuario y grupo `salt` con `uid` y `gid` `1000`. Desde el host los volúmenes de datos montados se mostrarán con propiedad del _usuario:grupo_ `1000:1000`. Esto tener efectos desfavorables si los ids no coinciden o si los permisos de los archivos montados son muy restrictivos. Especialmente el directorio de claves y sus contenidos.
Expand Down Expand Up @@ -678,6 +717,8 @@ A continuación puedes encontrar una lista con las opciones disponibles que pued
| `SALT_API_USER_PASS_FILE` | Archivo con la contraseña para el usuario `SALT_API_USER`. Usa esta variable para establecer la ruta del archivo que contiene la contraseña del usuario `SALT_API_USER`. Es útil para cargar la contraseña usando _secrets_. Esta variable tiene preferencia frente a `SALT_API_USER_PASS`. Por defecto: _No establecida_. |
| `SALT_API_USER_PASS` | Contraseña del usuario `SALT_API_USER`. Requerida si `SALT_API_SERVICE_ENBALED` es `True`, `SALT_API_USER` no está vacía y no se ha definido `SALT_API_USER_PASS_FILE`. Por defecto: _No establecida_. |
| `SALT_API_CERT_CN` | _Common name_ en el certificado de `salt-api`. Por defecto: `localhost`. |
| `SALT_MINION_ENABLED` | Habilita el servicio `salt-minion`. Por defecto: `False`. |
| `SALT_MINION_ID` | El id del minion. Por defecto: `builtin.minion`. |
| [`SALT_MASTER_SIGN_PUBKEY`](https://docs.saltproject.io/en/latest/ref/configuration/master.html#master-sign-pubkey) | Firma las respuestas de `salt-master` con una firma criptográfica usando la clave pública del master. Valores permitidos: `True` o `False`. Por defecto: `False`. |
| [`SALT_MASTER_USE_PUBKEY_SIGNATURE`](https://docs.saltproject.io/en/latest/ref/configuration/master.html#master-use-pubkey-signature) | En lugar de calcular la firma para cada respuesta, usa una firma pre-calculada. Esta opción requiere que `SALT_MASTER_SIGN_PUBKEY` sea `True`. Valores posibles: `True` or `False`. Por defecto: `True`. |
| [`SALT_MASTER_SIGN_KEY_NAME`](https://docs.saltproject.io/en/latest/ref/configuration/master.html#master-sign-key-name) | El nombre del par de claves de firma sin sufijo. Por defecto: `master_sign`. |
Expand Down

0 comments on commit c8a2666

Please sign in to comment.