diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 798d412..8c5ea50 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -86,11 +86,12 @@ dest: /etc/hosts regexp: "{{ item.regexp }}" line: "{{ item.line }}" + backrefs: yes with_items: - - {regexp: "^127.0.0.1.+localdomain4$", + - {regexp: "^127\.0\.0\.1.+localdomain4$", line: "127.0.0.1 localhost {{ ansible_hostname }}" } - - {regexp: "^::1.+localdomain6$", + - {regexp: "^\:\:1.+localdomain6$", line: "::1 localhost {{ ansible_hostname }}" } - {regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_default_ipv4.address.split('.')[-1] }}$",