Skip to content

Instantly share code, notes, and snippets.

@SEJeff
Created June 26, 2012 21:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save SEJeff/2999174 to your computer and use it in GitHub Desktop.
Save SEJeff/2999174 to your computer and use it in GitHub Desktop.
Sending eth0's ip as a variable to a salt template file
/var/www/myip.html:
file.managed:
- source: salt://roles/wordpress/files/myip.html.jinja
- user: root
- group: root
- mode: 640
- template: jinja
- context:
hostname: {{ grains['fqdn'] }}
ip: {{ salt['network.interfaces']()['eth0']['ipaddr'] }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment