Skip to content

Instantly share code, notes, and snippets.

Created January 31, 2014 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f690c07e0e118bba1cfe to your computer and use it in GitHub Desktop.
Save anonymous/f690c07e0e118bba1cfe to your computer and use it in GitHub Desktop.
[root@manager ~]# salt '*' network.ip_addrs eth2
mysql-master:
- 192.168.1.2
webserver2:
- 192.168.1.1
webserver5:
- 192.168.1.5
webserver3:
- 192.168.1.4
webserver1:
webserver4:
- 192.168.1.6
Teniu correu en /var/spool/mail/root
[root@manager ~]# salt '*' network.ip_addrs eth2 |sed -e 's/:/:\n host.present:/g'|sed -e 's/- /- ip: /g'
mysql-master:
host.present:
- ip: 192.168.1.2
webserver2:
host.present:
- ip: 192.168.1.1
webserver3:
host.present:
- ip: 192.168.1.4
webserver1:
host.present:
webserver5:
host.present:
- ip: 192.168.1.5
webserver4:
host.present:
- ip: 192.168.1.6
Teniu correu en /var/spool/mail/root
[root@manager ~]# salt '*' network.ip_addrs eth2 |sed -e 's/:/:\n host.present:/g'|sed -e 's/- /- ip: /g' >> hosts
[root@manager ~]# salt 'webserver2' state.sls hosts
webserver2:
Data failed to compile:
----------
The state "webserver1" in sls hosts is not formed as a list
[root@manager ~]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment