remove ipv6 check; remove notify

This commit is contained in:
2025-04-09 11:09:00 -04:00
parent 40f14e2ef7
commit f71c2348b1
3 changed files with 26 additions and 18 deletions

View File

@ -8,19 +8,19 @@
ansible.builtin.debug:
var: ansible_hostname
- name: Check for IPv6 configuration
- name: Toggle IPv6 off
ansible.builtin.shell:
cmd: grep -i ipv6 /etc/sysconfig/network-scripts/ifcfg-*
failed_when: false
cmd: "echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6"
changed_when: false
register: ipv6_interfaces
- name: Debug ipv6_interfaces
ansible.builtin.debug:
var: ipv6_interfaces
- name: Disable IPv6 for future reboots
ansible.builtin.lineinfile:
path: /etc/sysctl.conf
line: "net.ipv6.conf.all.disable_ipv6 = 1"
state: present
# notify: Sysctl_update
when:
- ipv6_interfaces['stdout_lines'] is defined
- ipv6_interfaces['stdout_lines'] | length > 0
- ipu_disable_ipv6 | default(false) | bool
- name: Define IP address for NFS export job
ansible.builtin.set_stats:
@ -28,3 +28,10 @@
ip_addresses: "{{ ansible_all_ipv4_addresses }}"
server_hostname: "{{ ansible_hostname }}"
aggregate: true
handlers:
- name: Sysctl_update
ansible.builtin.command:
cmd: sysctl -p
changed_when: false