Public | Automated Build

Last pushed: a year ago
Short Description
Test salt states and pillars
Full Description

Test Salt in Docker

Docker image to test salt states and pillars with a highstate for any hostname. In examples below, $(pwd) is assumed to return salt states root directory, the one with top.sls.

Available docker images

docker pull tomologic/salt-test:centos6
docker pull tomologic/salt-test:debian7
docker pull tomologic/salt-test:debian8
docker pull tomologic/salt-test:ubuntu14.04
docker pull tomologic/salt-test:ubuntu14.10

Run highstate for any hostname

Navigate to your salt states location and run:

docker run -i -v $(pwd):/srv/salt -h hostname.example.com tomologic/salt-test:centos6

Run specific states

The first argument will be passed to state.sls. Navigate to your salt states location and run:

docker run -i -v $(pwd):/srv/salt tomologic/salt-test:centos6 nginx

You can run multiple states at once:

docker run -i -v $(pwd):/srv/salt tomologic/salt-test:centos6 nginx.ssl,postgresql

Use pillar data

To use pillar data as well, mount pillar directory at /srv/pillar with another -v option.

docker run -i -v $(pwd):/srv/salt -v /path/to/pillar:/srv/pillar -h hostname.example.com tomologic/salt-test:centos6

Use grains data

To use grains, mount a grains file at /etc/salt/grains. See http://docs.saltstack.com/en/latest/topics/targeting/grains.html#grains-in-etc-salt-grains

docker run -i -v $(pwd):/srv/salt -v /path/to/grains.example:/etc/salt/grains tomologic/salt-test:centos6

Build your own images

The update.sh script in this repository spreads files to all subdirectories. More graceful way to share files between several dockerfiles is welcome.

This is how you use the Makefile:

make os=centos6 build

License

This code is in public domain. See LICENSE file for full information. You don't even have to keep any copyright/license text if you use the code elsewhere.

Limitations

  • Only tests the 'base' environment
Docker Pull Command
Owner
tomologic
Source Repository