Created
October 31, 2012 14:50
-
-
Save unicolet/3987451 to your computer and use it in GitHub Desktop.
Generate a dns zone definition from Salt
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
@ in soa localhost. root 1 3H 15M 1W 1D | |
ns localhost. | |
{% set nets=salt['publish.publish']('*','network.interfaces') %}{% for n in nets %}{% set pdata=salt['publish.publish'](n,'pillar.data') %}{% if pdata.has_key(n) %}{% if pdata[n].has_key('zone') %}{% if pdata[n]['zone']=='linuxservers' %} | |
{{ n }} IN A {{ nets[n]['eth0']['inet'][0]['address'] }} | |
{% endif %}{% endif %}{% endif %}{% endfor %} |
dangarthwaite
commented
Feb 13, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment