docker-salt-masterless
This repository contains a set of Docker images that install and configure a masterless SaltStack. Available Dockers are based on different distributions:
- CentOS 6 (
Dockerfile
) - CentOS 7 (
Dockerfile
) - Ubuntu 14.04 (
Dockerfile
) - Ubuntu 16.04 (
Dockerfile
) - Debian 8 (
Dockerfile
)
Building Docker images
To build all the images, you can use the make
$ make
... take a 10 minutes rest ...
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
salt-masterless centos7 de366801c3de 8 minutes ago 423.7 MB
salt-masterless centos6 f15d3479bc6a 8 minutes ago 398.9 MB
salt-masterless ubuntu16.04 53d9bdf28b88 8 minutes ago 411.6 MB
salt-masterless ubuntu14.04 0e2646404daf 8 minutes ago 398.3 MB
salt-masterless debian8 89e6c1590125 8 minutes ago 359.3 MB
...
To test an image
$ docker run -ti --rm salt-masterless:debian8
root@53d9bdf28b88$ salt-call --local test.ping
...
root@53d9bdf28b88$ salt-call --local state.show_highstate
...
root@53d9bdf28b88$ salt-call --local state.highstate
...
Adding and tesing custom Salt states
To test your own state, add it under states
and rebuild the
image(s).
$ touch ./states/myownstate.sls
... edit your state ...
$ make
... take a few minutes rest ...
$ docker run -ti --rm salt-masterless:debian8
root@53d9bdf28b88$ salt-call --local test.ping
...
root@53d9bdf28b88$ salt-call --local state.show_sls myownstate
...
root@53d9bdf28b88$ salt-call --local state.apply myownstate
...
Alternatively, you can create your own Docker image by creating a Dockerfile
like the following
FROM salt-masterless:centos7
ADD myownstate.sls /srv/salt/myownstate.sls
ADD anotherstate.sls /srv/salt/anotherstate.sls
Updating Minion's configuration
To update the masterless Minion's configuration, add a .conf
file in
minion.d
and rebuild the image(s).