• Stars
    star
    193
  • Rank 201,081 (Top 4 %)
  • Language SaltStack
  • License
    Other
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yes, Salt can Salt itself!

salt-formula

Travis CI Build Status Semantic Release

Yes, Salt can Salt itself!

General notes

See the full SaltStack Formulas installation and usage instructions.

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

Contributing to this repo

Commit message formatting is significant!!

Please see How to contribute for more details.

Available states

salt

Meta-state (This is a state that includes other states).

This calls all runable states based on configured pillar data.

salt.minion

Install a minion

salt.master

Install a master.

salt.syndic

Install a syndic.

salt.cloud

Install salt cloud.

salt.ssh

Install salt-ssh with roster file. Configure pillar data under salt:ssh_roster to feed the template.

salt.api

Install salt api Requisite: Configure salt-master with rest_cherrypy or rest_tornado.

salt.standalone

Install a minion and configure it in standalone mode.

salt.gitfs.dulwich

Install gitfs backend dulwich dependencies. Set salt:master:gitfs_provider: dulwich in your pillar.

salt.gitfs.gitpython

Install gitfs backend GitPython dependenciess. Set salt:master:gitfs_provider: gitpython in your pillar.

salt.gitfs.keys

Install ssh keys to be used by gitfs

salt.gitfs.pygit2

Install gitfs backend libgit2/pygit2 dependenciess. Set salt:master:gitfs_provider: pygit2 in your pillar. For EL distributions, pygit is installed from packages from EPEL.

salt.pkgrepo

It is recommended to use SaltStack repository for Debian, RedHat, and SuSE, to benefit from the latest stable salt release. Refer to official documentation at <http://docs.saltstack.com/en/latest/topics/installation/index.html#platform-specific-installation-instructions>`_.

salt.pkgrepo.clean

Undo the effects of salt.pkgrepo on Debian, RedHat, and SuSE.

salt.formulas

Clone selected Salt formulas Git repositories under /srv/formulas and makes them available in the relevant file_roots settings. Please note that in order for file_roots to be updated, salt.master must be called after salt.formulas. For example:

base:
  'saltmain':
    - salt.formulas
    - salt.master

Pillar data can be used to customize all paths, URLs, etc. Here's a minimal pillar sample installing two formulas in the base environment:

salt_formulas:
  list:
    base:
      - salt-formula
      - openssh-formula

See pillar.example for an exhaustive list of settings available via pillar. Note that by default this state:

  • downloads the latest formulas from the saltstack-formulas project on GitHub.
  • does not update the local repositories after the initial clone. This is a safety measure since you do not control how the official repositories evolve.

If you configure the state to download the formulas from repositories that you control, then you can safely enable the salt_formulas:git_opts:default:update pillar setting to True.

Configuration

Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under salt['master'], salt['minion'] or salt['cloud']. Options specified in salt['minion'] which are not present in the default configuration file will be added to the end of the configuration file.

salt:
  ret_port: 4506
  master:
    user: saltuser
    ...
  minion:
    user: saltuser
    ...
  cloud:
    providers: ec2
    ...

Extending

Additional templates can be added by the user under salt/files/minion.d and master.d. This might be useful if, for example, a recently-added configuration option is not yet provided by the default template.

Vagrant

Executing the provided Vagrantfile will create a Ubuntu 14.04 VM, add the default Saltstack Repository and install the current stable version.

The folders inside the VM will be set up in a way that enables you to simply execute 'sudo salt "*" state.highstate' to apply the salt formula to the VM, using the pillar.example config. You can check /etc/salt/ for results.

Remember, you will have to run state.highstate or state.sls salt.(master|minion|cloud) manually.

MacOS Support

As MacOS has no native package management that pkg.installed can leverage appropriately, and brew does not count, the salt.minion state manages salt minion package upgrades by way of .pkg file download which is then installed using the macpackage.installed state.

salt-minion packages on MacOS will not be upgraded by default. To enable package management you must set the following at a minimum,

install_packages: True
version: 2017.7.4
salt_minion_pkg_source: https://repo.saltproject.io/osx/salt-2017.7.4-py3-x86_64.pkg

install_packages must indicate that the installation of a package is desired. If so, version will be used to compare the version of the installed .pkg against the downloaded one. If version is not set and a salt.pkg is already installed the .pkg will not be installed again.

A future update to the formula may include extraction of version from the downloaded .pkg itself; but for the time being you MUST set version to indicate what you believe it to be.

Refer to pillar.example for more information.

Testing

Linux testing is done with kitchen-salt.

Requirements

  • Ruby
  • Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3.

bin/kitchen converge

Creates the docker instance and runs the salt main states, ready for testing.

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the docker instance.

bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

bin/kitchen login

Gives you SSH access to the instance for manual testing.

Testing with Vagrant

Windows/FreeBSD/OpenBSD testing is done with kitchen-salt.

Requirements

  • Ruby
  • Virtualbox
  • Vagrant

Setup

$ gem install bundler
$ bundle install --with=vagrant
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.vagrant.yml, e.g. windows-81-latest-py3.

Note

When testing using Vagrant you must set the environment variable KITCHEN_LOCAL_YAML to kitchen.vagrant.yml. For example:

$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test      # Alternatively,
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
$ bin/kitchen test

Then run the following commands as needed.

bin/kitchen converge

Creates the Vagrant instance and runs the salt main states, ready for testing.

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the Vagrant instance.

bin/kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

bin/kitchen login

Gives you RDP/SSH access to the instance for manual testing.

More Repositories

1

nginx-formula

Nginx Salt Formula
SaltStack
163
star
2

docker-formula

Install and set up Docker
SaltStack
137
star
3

template-formula

SaltStack formula template filled with dummy content
Jinja
116
star
4

users-formula

Configure users via pillar
SaltStack
98
star
5

openssh-formula

Jinja
90
star
6

mysql-formula

Install the MySQL client and/or server
SaltStack
81
star
7

ec2-autoscale-reactor

Autonomous Minion Management via EC2 Autoscaler
SaltStack
77
star
8

postgres-formula

SaltStack
75
star
9

php-formula

Jinja
57
star
10

zabbix-formula

Jinja
51
star
11

apache-formula

Set up and configure the Apache HTTP server
Jinja
49
star
12

django-formula

Python
42
star
13

jenkins-formula

SaltStack
42
star
14

os-hardening-formula

SaltStack
41
star
15

redis-formula

Redis state
Jinja
40
star
16

fail2ban-formula

SaltStack
40
star
17

sudoers-formula

Ruby
40
star
18

salt-cloud-reactor

Autonomous Minion Management via Salt Cloud
SaltStack
38
star
19

hadoop-formula

SaltStack
37
star
20

openvpn-formula

Setup and configure openvpn server and client.
Jinja
34
star
21

hostsfile-formula

Use minion IDs to keep /etc/hosts and hostnames consistent for clusters without DNS
Ruby
32
star
22

gitlab-formula

SaltStack
31
star
23

mongodb-formula

SaltStack
31
star
24

vim-formula

Trick out vim
Vim Script
31
star
25

iptables-formula

SaltStack
31
star
26

bind-formula

Ruby
30
star
27

prometheus-formula

Manage a Prometheus installation
SaltStack
27
star
28

haproxy-formula

Jinja
27
star
29

zookeeper-formula

Jinja
27
star
30

node-formula

Manage node.js with SaltStack
SaltStack
26
star
31

postfix-formula

Ruby
26
star
32

logstash-formula

SaltStack
24
star
33

sun-java-formula

Flexible provisioning for JDK and JRE tarballs
SaltStack
24
star
34

epel-formula

Install the EPEL RPM and GPG key
Ruby
23
star
35

ntp-formula

Ruby
23
star
36

systemd-formula

SaltStack
23
star
37

consul-formula

Formula to install and configure Hashicorp Consul
Jinja
23
star
38

logrotate-formula

Ruby
22
star
39

rabbitmq-formula

SaltStack
22
star
40

nagios-formula

nagios-formula
SaltStack
22
star
41

openstack-standalone-formula

Single Server OpenStack
SaltStack
22
star
42

lxd-formula

Python
21
star
43

elasticsearch-formula

SaltStack
21
star
44

collectd-formula

SaltStack
20
star
45

kubernetes-formula

Salt formula to manage kubernetes
SaltStack
20
star
46

aptly-formula

SaltStack
18
star
47

libvirt-formula

Jinja
18
star
48

sysctl-formula

Saltstack sysctl formula,
Ruby
18
star
49

icinga2-formula

SaltStack
18
star
50

snmp-formula

Ruby
17
star
51

nfs-formula

Ruby
17
star
52

samba-formula

Jinja
17
star
53

tomcat-formula

Ruby
16
star
54

graphite-formula

SaltStack
16
star
55

vault-formula

Ruby
15
star
56

git-formula

SaltStack
14
star
57

syslog-ng-formula

Jinja
14
star
58

memcached-formula

SaltStack
14
star
59

vmware-tools-formula

SaltStack
13
star
60

ceph-formula

HTML
13
star
61

virtualenv-formula

SaltStack
11
star
62

resolver-formula

SaltStack
11
star
63

openldap-formula

Ruby
11
star
64

packages-formula

A simple 'packages manager' formula, to install/remove packages without further ado.
SaltStack
11
star
65

java-formula

Jinja
11
star
66

tinc-formula

tinc formula
Shell
11
star
67

tmux-formula

HTML
11
star
68

grafana-formula

Manage Grafana via Salt
SaltStack
10
star
69

squid-formula

Ruby
10
star
70

openvpn-client-formula

A saltstack formula for pushing keys and config to openvpn clients.
SaltStack
9
star
71

reverse-users-formula

9
star
72

uwsgi-formula

Salt formula to manage uwsgi
SaltStack
9
star
73

kafka-formula

SaltStack
8
star
74

screen-formula

SaltStack
8
star
75

python2-formula

SaltStack
8
star
76

dhcpd-formula

Ruby
8
star
77

dnsmasq-formula

Ruby
8
star
78

pip-formula

SaltStack
7
star
79

backuptocloud-formula

http://docs.saltstack.com/topics/conventions/formulas.html
SaltStack
7
star
80

opendkim-formula

Salt-Stack formula for opendkim
SaltStack
7
star
81

cloudstack-formula

SaltStack
7
star
82

hosts-formula

Manage your hosts file
Python
7
star
83

munin-formula

Saltstack formula for munin and munin-node
SaltStack
7
star
84

newrelic-formula

SaltStack
7
star
85

piwik-formula

SaltStack
7
star
86

beaver-formula

Shell
7
star
87

owncloud-formula

SaltStack
7
star
88

nexus-formula

Provision Sonatype Nexus with Saltstack
Shell
7
star
89

crontab-formula

saltstack formula to manage crontab
HTML
6
star
90

wireguard-formula

Manages wireguard installations
Jinja
6
star
91

dovecot-formula

SaltStack
6
star
92

varnish-formula

SaltStack
6
star
93

mounts-formula

SaltStack formula for managing mounts
SaltStack
6
star
94

bareos-formula

A Saltstack formula to install and configure Bareos
SaltStack
5
star
95

linux-dev-formula

Development files for linux
Scheme
5
star
96

nano-formula

Scheme
5
star
97

eramba-formula

Scheme
5
star
98

mediawiki-formula

MediaWiki
PHP
5
star
99

reverse-grains-formula

SaltStack
5
star
100

ruby-formula

SaltStack
5
star