Coder Social home page Coder Social logo

salt-docker's Introduction

Easy Salt testing with Docker forked from jacksoncage/salt-docker

This repo provides a Salt setup with one master and one (or multiple) minions to be able to test and work with states, pillars and all other salt functionality. By using docker it's easy to reproduce and test you code.

Image includes both salt-master, salt-minion, salt-api and also salt-cloud to be able to test and troubleshoot all things salt. SALT_USE environment variable is used to determent if container should be running as master or minion.

Salt master is auto accepting all minions.

Salt versions

Latest from Saltstack repository for Debian Jessie

  • 2016.3.0 (Boron) in 20160917 except tag:minideb
  • 2016.11.1 in 20161229 tag:minideb

Get it running

Salt master/minon with docker run

Run one container with a master/minion setup.

docker run -i -t --name=saltdocker_master_1 -h master -p 4505 -p 4506 \
   -p 8080 -p 8081 -e SALT_NAME=master -e SALT_USE=master \
   -v `pwd`/srv/salt:/srv/salt:rw freprod/salt

By jumping in with docker exec -i -t saltdocker_master_1 bash your able to test/troubleshoot. Now your ready to write you states and test them out.

Salt cluster with docker compose

Using docker-compose to get a multi-minion setup. Copy and configure docker-compose.yml.example to docker-compose.yml and run the following

docker-compose up

By jumping in with docker exec -i -t saltdocker_master_1 bash your able to test/troubleshoot. Now your ready to write you states and test them out.

Environment variables

Env variables are used to set config on startup, you can set the following envs

  • SALT_USE - master/minion, defaults to master
  • SALT_NAME - minion name, defaults to to master
  • SALT_GRAINS - set minion grains as json, defaults to none
  • LOG_LEVEL - log level, defaults to info
  • OPTIONS - other options passed into salt process, defaults to none

Volumes

Following paths can be mounted from the container. /srv/salt is needed to run your local states.

  • /etc/salt - Master/Minion config
  • /var/cache/salt - job data cache
  • /var/log/salt - logs
  • /srv/salt - states, pillar reactors

Tags

Tag represent distribution based.

  • ubuntu14.04
  • ubuntu16.04
  • latest (Debian Jessie)
  • minideb (bitnami/minideb)
  • develop (do not use it!)

Build

Use the pre built image

The pre built image can be downloaded using docker directly. After that you do not need to use this command again, you will have the image on your local computer.

docker pull fredprod/salt

Build the docker image by yourself

If you prefer you can easily build the docker image by yourself. After this the image is ready for use on your machine and can be used for multiple starts.

git clone [email protected]:fredprod/salt-docker.git
cd salt-docker
docker build -t fredprod/salt .

salt-docker's People

Contributors

fredprod avatar jacksoncage avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.