Created
March 15, 2013 10:06
-
-
Save adiroiban/5168770 to your computer and use it in GitHub Desktop.
Idea of describing salt state for proxy minion
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
# | |
# Define remote system config as a pillar | |
# | |
gateway: | |
host: hostname | |
port: 22 | |
protocol: ssh | telnet # uses scp/ssh or rcp/rsh | |
ssh_key: "/path/on/local/minion" | |
server_fingerpring: '34:32:a4:32:32:32:a4:32:a4' | |
# | |
# In state | |
# | |
# Generic state to copy a file on a non-salt system. | |
gateway-hosts: | |
file.proxy_present: | |
- name: /jffs/etc/hosts | |
- source: salt://bla | |
- target: pillars['gateway'] | |
# Generic state to execute a remote command. | |
gateway-restart-ssh: | |
cmd.proxy_run: | |
- name: /etc/init.d/dropbear restart | |
- target: pillars['gateway'] | |
gateway-restart-ssh: | |
cmd.proxy_wait: | |
- name: /etc/init.d/dropbear restart | |
- target: pillars['gateway'] | |
- watch: | |
file: gateway-restart-ssh | |
# Generic nvram key-value state | |
gateway-configuration: | |
ddwrt.proxy_nvram: # of just ddwrt.nvram | |
- name: static_leases | |
- content: '77:45:43:43:43:43=host1=172.20.0.1= 77:45:43:43:43:43=host2=172.20.0.2=' | |
- target: pillars['gateway'] | |
# Specialized nvram add lease | |
host1-lease: | |
ddwrt.proxy_static_leases_present: # or just ddwrt.static_leases_present | |
- name: 77:45:43:43:43:43 | |
- hostname: host1 | |
- ip: 172.20.0.1 | |
# Specialized nvram remove lease | |
host1-old-lease: | |
ddwrt.proxy_static_leases_absent: | |
- name: 77:45:43:43:43:43 | |
- target: pillars['gateway'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment