Commit d129ab7b authored by PizZaKatZe's avatar PizZaKatZe
Browse files

Fix /etc/hosts

parent f5e34b3e
......@@ -18,11 +18,18 @@
hostname:
name: '{{ hostname }}'
- name: Delete old hostname from /etc/hosts
lineinfile:
path: /etc/hosts
regexp: "^127.0.1.1.*"
state: absent
- name: Update /etc/hosts
replace:
lineinfile:
path: /etc/hosts
regexp: '(\s+)debian$'
replace: '\1{{hostname}}'
insertafter: "^127.0.0.1[ \t]+localhost"
regexp: "^{{ addr }}\t.*"
line: "{{ addr }}\t{{ fqdn }}\t{{ hostname }}"
- name: Configure DNS
copy:
......
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