ipv4 only work

This commit is contained in:
2026-09-16 01:19:59 -04:00
parent 5fcf27241c
commit fa775425d1
24 changed files with 89 additions and 275 deletions
+32
View File
@@ -0,0 +1,32 @@
# code: language=ansible
- name: Disable ipv6 (all)
ansible.posix.sysctl:
name: "{{ item }}"
reload: true
state: present
sysctl_set: true
value: 1
loop:
- net.ipv6.conf.all.disable_ipv6
- net.ipv6.conf.default.disable_ipv6
- net.ipv6.conf.lo.disable_ipv6
notify:
- Reboot
- name: Remove IPv6 localhost entries from /etc/hosts
when:
- (ipv4_only | default(false))
ansible.builtin.lineinfile:
path: /etc/hosts
line: "{{ item }}"
state: absent
loop:
- '::1 localhost ip6-localhost ip6-loopback'
- 'ff02::1 ip6-allnodes'
- 'ff02::2 ip6-allrouters'
notify:
- Reboot
- name: Flush handlers to trigger reboot if required
ansible.builtin.meta: flush_handlers