main.yml 267 B

12345678
  1. ---
  2. - name: Remove localhost hostname definition
  3. lineinfile:
  4. path: /etc/hosts
  5. # hostnamectl doesn't update the hostname in this entry, so we can't
  6. # match against {{ ansible_facts['nodename'] }}.
  7. regexp: "^127\\.0\\.1\\.1[ \\t]+"
  8. state: absent