From f71c2348b103f9f48bbb53fe2f0c6e04f47db9c1 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 9 Apr 2025 11:09:00 -0400 Subject: [PATCH] remove ipv6 check; remove notify --- .gitignore | 1 + preupgrade.yml | 18 +++++++++--------- upgradeoscheck.yml | 25 ++++++++++++++++--------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 1c91c7c..1d21c8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ roles collections +*copy.yml diff --git a/preupgrade.yml b/preupgrade.yml index 862fd6a..f60c0fd 100644 --- a/preupgrade.yml +++ b/preupgrade.yml @@ -13,15 +13,15 @@ - floppy - pata_acpi - - name: Disable IPv6 (will be left disabled post-IPU) - ansible.builtin.blockinfile: - path: /etc/sysctl.conf - block: | - net.ipv6.conf.all.disable_ipv6 = 1 - net.ipv6.conf.default.disable_ipv6 = 1 - notify: Sysctl_update - when: - - ipu_disable_ipv6 | default(false) | bool + # - name: Disable IPv6 (will be left disabled post-IPU) + # ansible.builtin.blockinfile: + # path: /etc/sysctl.conf + # block: | + # net.ipv6.conf.all.disable_ipv6 = 1 + # net.ipv6.conf.default.disable_ipv6 = 1 + # notify: Sysctl_update + # when: + # - ipu_disable_ipv6 | default(false) | bool - name: Leapp Pre-Upgrade block: diff --git a/upgradeoscheck.yml b/upgradeoscheck.yml index 119341c..68de81c 100644 --- a/upgradeoscheck.yml +++ b/upgradeoscheck.yml @@ -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