- Install vagrant from https://www.vagrantup.com.
- Get the source code of this repo.
- Copy
Vagrantfile.dist
toVagrantfile
and runvagrant up
salt-call state.sls id
— apply single state with specified id.salt-call state.highstate
— apply all available states.salt-call state.show_sls id
— debug state with specified id.
Name | Description |
---|---|
motd | very basic file template. |
nginx | install Nginx from official repo. |
memcached | install Memcached with different configurations. |
cron | use state and file definition of cron task. |
user | add specific user and group. |
postgresql | install and configure Postgresql from pgdg repo. |
pgbouncer | install and configure Pgbouncer from pgdg repo. |
java | accept licence and install java 1.8. |
util | some basic utils. |
├── etc
│ └── salt # Salt (minion) configuration
└── srv
├── pillar # Salt data
│ ├── base # for "base" environment
│ ├── dev # for "development" environment
│ ├── prod # for "production" environment
│ └── test # for "test" environment
└── salt # Salt states
└── base # "base" used by default
- Log in to your virtual machine
vagrant ssh
. - Became a root:
sudo -i
- Call
salt-call state.sls motd
to raise motd state.
It should produce output like this:
local:
----------
ID: /etc/motd
Function: file.managed
Result: True
Comment: File /etc/motd updated
Started: 11:45:30.441914
Duration: 48.488 ms
Changes:
----------
diff:
New file
mode:
0644
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
- Call
salt-call state.highstate
to raise all available states.
It should produce the following output:
...
ID: nginx
Function: pkg.installed
Result: True
Comment: The following packages were installed/updated: nginx
Started: 12:01:52.293880
Duration: 189716.635 ms
Changes:
...
----------
ID: nginx
Function: service.running
Result: True
Comment: The service nginx is already running
Started: 12:05:02.201175
Duration: 31.232 ms
Changes:
...
- Add Centos mappings.
- Provide multimachine example with grains.