This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mine_functions: | |
private_ips: | |
network.ip_addrs | |
eth1 | |
fqdn: | |
grains.get | |
fqdn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mine_functions: | |
private_ips: | |
- mine_function: network.ip_addrs | |
- eth1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webserver_private_ips = [] | |
web_interfaces = __salt__['mine.get']('web*{0}*'.format(client_id), 'network.interfaces') | |
webserver_private_ips = [] | |
for minion, interface in web_interfaces.iteritems(): | |
for name, data in interface.iteritems(): | |
if name == 'eth1': | |
webserver_private_ips.append(data['inet'][0]['address']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!py | |
def basic_packages(states): | |
pkgs = [ | |
'vim', | |
'unzip', | |
'sendmail', | |
'iftop', | |
'python-mysqldb', | |
'sysstat' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(salt-master) # salt dns2.phx.devops.my-domain.com geodns.get_zone devops.my-domain.com | |
dns2.phx.devops.my-domain.com: | |
The minion function caused an exception: Traceback (most recent call last): | |
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1161, in _thread_return | |
return_data = func(*args, **kwargs) | |
File "/var/cache/salt/minion/extmods/modules/geodns.py", line 37, in get_zone | |
zone = _get_zone(name) | |
File "/var/cache/salt/minion/extmods/modules/geodns.py", line 19, in _get_zone | |
datadir = __pillar__['geodns.datadir'] | |
KeyError: 'geodns.datadir' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mine_functions: | |
network.interfaces: [] | |
network.ip_addrs: | |
- eth0 | |
minion_id: | |
- mine_function: grains.get | |
- id | |
fqdn: | |
- mine_function: grains.get | |
- fqdn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# passing pillar manually works | |
salt 'dns2*' state.sls dns.new_minion "pillar={'new_minion': 'foobar'}" | |
# passing via 'kwarg' key in the reactor file start.sls does not work | |
# on minion: | |
root@lb1:~# salt-call event.send 'salt/minion/lb1.phx.9999.devops.some-domain.com/start' | |
local: | |
True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@dns2:~# salt-call event.fire "{'foo': 123}" 'start' | |
local: | |
True | |
root@dns2:~# salt-call event.send 'start' | |
local: | |
True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mine_functions: | |
network.interfaces: [] | |
network.ip_addrs: [] | |
fqdn: | |
- mine_function: grains.get | |
- fqdn | |
domain: | |
- mine_function: grains.get | |
- domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if int(go_version.split('.')[1]) > 4: | |
states['install-go-bootstrap'] = { | |
'cmd.run': { | |
{'name': 'source /root/.gvm/scripts/gvm && gvm install go1.4'}, | |
{'shell': '/bin/bash'}, | |
{'require': [ | |
{'cmd': 'install-gvm'} | |
]} | |
} | |
} |