Adding Backrefs

This commit is contained in:
2016-08-18 23:23:14 +12:00
parent 5896493392
commit 4a5da9bf15

View File

@@ -86,11 +86,12 @@
dest: /etc/hosts dest: /etc/hosts
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
line: "{{ item.line }}" line: "{{ item.line }}"
backrefs: yes
with_items: with_items:
- {regexp: "^127.0.0.1.+localdomain4$", - {regexp: "^127\.0\.0\.1.+localdomain4$",
line: "127.0.0.1 localhost {{ ansible_hostname }}" line: "127.0.0.1 localhost {{ ansible_hostname }}"
} }
- {regexp: "^::1.+localdomain6$", - {regexp: "^\:\:1.+localdomain6$",
line: "::1 localhost {{ ansible_hostname }}" line: "::1 localhost {{ ansible_hostname }}"
} }
- {regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_default_ipv4.address.split('.')[-1] }}$", - {regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_default_ipv4.address.split('.')[-1] }}$",