Add hosts file entry for inventory_hostname

master
Mike Holloway 3 months ago
parent 904942ce5e
commit a760d6f3fb
  1. 17
      tasks/main.yml

@ -26,6 +26,23 @@
selinux_permissive:
name: container_t
permissive: true
- name: Add hosts file entry for hostname
lineinfile:
path: /etc/hosts
regexp: '^127\.0\.0\.1'
line: "127.0.0.1 {{ inventory_hostname }} localhost localhost.localdomain localhost4 localhost4.localdomain4"
owner: root
group: root
mode: 0644
- lineinfile:
path: /etc/hosts
regexp: '^::1'
line: "::1 {{ inventory_hostname }} localhost localhost.localdomain localhost6 localhost6.localdomain6"
owner: root
group: root
mode: 0644
# - name: Copy cni networking driver config into place
# blockinfile:
# name: "/etc/cni/net.d/podman.conflist"

Loading…
Cancel
Save