Skip to content

Instantly share code, notes, and snippets.

@hostmaster
Forked from jlund/main.yml
Created July 31, 2013 12:39
Show Gist options
  • Select an option

  • Save hostmaster/6121639 to your computer and use it in GitHub Desktop.

Select an option

Save hostmaster/6121639 to your computer and use it in GitHub Desktop.
- name: Set the hostname in rc.conf
lineinfile: dest=/etc/rc.conf regexp="^hostname" line='hostname="{{ hostname }}"'
register: hostnamestatus
- name: Set the hostname
command: hostname {{ hostname }}
when: hostnamestatus.changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment