Commit 283d6db5 authored by Chris's avatar Chris
Browse files

Insert the hostname into /etc/hosts near the top

parent f3d7798e
......@@ -18,9 +18,10 @@
- name: Update /etc/hosts to use new hostname
lineinfile:
dest: /etc/hosts
regexp: '^127.0.1.1'
line: '127.0.1.1 {{ hostname }}'
regexp: '^127.0.1.1\s{{ hostname }}'
line: "127.0.1.1\t{{ hostname }}"
state: present
insertafter: "^127.0.0.1\t"
- name: Set 'ansible_hostname' fact to the new hostname
set_fact:
ansible_hostname: '{{ hostname }}'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment