mirror of
https://github.com/jbowdre/vagrant-saltlab.git
synced 2024-11-30 08:32:17 +00:00
start playing with top.sls
- assign two minions the 'roles:web' grain - create the 'cowsay' state - match the 'vim' state to all minions - match the 'cowsay' state to minions w/ 'roles:saltlab' - match the 'nginx' state to minions w/ 'roles:web'
This commit is contained in:
parent
8cbbe97d24
commit
cd1d0eb462
5 changed files with 20 additions and 7 deletions
10
README.md
10
README.md
|
@ -70,11 +70,7 @@ minion04:
|
||||||
True
|
True
|
||||||
```
|
```
|
||||||
|
|
||||||
And finally, as a treat, apply a [Salt state to install vim and my vimrc](srv/salt/vim/init.sls) on the minions with the `roles:saltlab` grain:
|
|
||||||
```shell
|
|
||||||
sudo salt -G 'roles:saltlab` state.apply vim
|
|
||||||
```
|
|
||||||
|
|
||||||
To blow it all away for a fresh start, just run `vagrant destroy -f`.
|
|
||||||
|
|
||||||
Happy Salting!
|
Happy Salting!
|
||||||
|
|
||||||
|
## Cleanup
|
||||||
|
To blow it all away for a fresh start, just run `vagrant destroy -f`.
|
||||||
|
|
2
Vagrantfile
vendored
2
Vagrantfile
vendored
|
@ -56,6 +56,7 @@ EOF
|
||||||
grains:
|
grains:
|
||||||
roles:
|
roles:
|
||||||
- saltlab
|
- saltlab
|
||||||
|
- web
|
||||||
EOF
|
EOF
|
||||||
systemctl restart salt-minion
|
systemctl restart salt-minion
|
||||||
SHELL
|
SHELL
|
||||||
|
@ -99,6 +100,7 @@ EOF
|
||||||
grains:
|
grains:
|
||||||
roles:
|
roles:
|
||||||
- saltlab
|
- saltlab
|
||||||
|
- web
|
||||||
EOF
|
EOF
|
||||||
systemctl restart salt-minion
|
systemctl restart salt-minion
|
||||||
SHELL
|
SHELL
|
||||||
|
|
3
srv/salt/cowsay/init.sls
Normal file
3
srv/salt/cowsay/init.sls
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
install_cowsay:
|
||||||
|
pkg.installed:
|
||||||
|
- name: cowsay
|
3
srv/salt/cowsay/uninstall.sls
Normal file
3
srv/salt/cowsay/uninstall.sls
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
uninstall_cowsay:
|
||||||
|
pkg.removed:
|
||||||
|
- name: cowsay
|
9
srv/salt/top.sls
Normal file
9
srv/salt/top.sls
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
base:
|
||||||
|
'*':
|
||||||
|
- vim
|
||||||
|
'roles:saltlab':
|
||||||
|
- match: grain
|
||||||
|
- cowsay
|
||||||
|
'roles:web':
|
||||||
|
- match: grain
|
||||||
|
- nginx
|
Loading…
Reference in a new issue