Skip to content

Instantly share code, notes, and snippets.

@kaidokert
Created December 15, 2015 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaidokert/f0bbbab39f83df2396cd to your computer and use it in GitHub Desktop.
Save kaidokert/f0bbbab39f83df2396cd to your computer and use it in GitHub Desktop.
{%- set fqdn = grains['id'] %}
{%- set internal_ip = grains['ip4_interfaces']['eth0'][0] %}
hostname-match:
file.managed:
- name: /etc/hostname
- contents: {{ fqdn }}
primary_ip_in_host_file:
host.present:
- ip: {{ internal_ip }}
- names:
- {{ fqdn }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment