Last active
August 17, 2016 16:43
-
-
Save toddc-unity3d/c12385c71d837b3aa36d33a8cdf2ca6c to your computer and use it in GitHub Desktop.
Salt Hosts files
This file contains hidden or 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
# <states>/top.sls | |
``` | |
base: | |
'*': | |
- hosts | |
``` | |
# <states>/hosts/init.sls | |
``` | |
include: | |
- hosts.hosts | |
``` | |
# <states>/hosts/hosts.sls | |
``` | |
{%- set pillar_hosts = salt['pillar.get']('hosts:hosts', {}) %} | |
{%- for ip, hostnames in pillar_hosts.items() %} | |
{{ ip }}-host-entry: | |
host.present: | |
- ip: {{ ip }} | |
- names: {{ hostnames }} | |
{% endfor %} | |
``` | |
# <pillar>/top.sls | |
``` | |
base: | |
'*': | |
- hosts | |
``` | |
# <pillar>/hosts/init.sls | |
``` | |
hosts: | |
'1.2.3.4': "host1 host1alias" | |
'1.2.3.5': "host 2" | |
'1.2.3.6': "host 3" | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment