Add hosts file entry for inventory_hostname

This commit is contained in:
Mike Holloway committed 2024-09-16 22:28:29 -04:00
1 parent 904942ce5e
commit a760d6f3fb
1 file changed
+17
+17
View File
@@ -26,6 +26,23 @@
selinux_permissive: selinux_permissive:
name: container_t name: container_t
permissive: true 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 # - name: Copy cni networking driver config into place
# blockinfile: # blockinfile:
# name: "/etc/cni/net.d/podman.conflist" # name: "/etc/cni/net.d/podman.conflist"