fix(ansible): update fact references to remove deprecation warnings (#715)

* chore(ansible): use ansible_facts

* fix(ansible): satisfy lint for fact migration

- wrap nested fact expressions to meet YAML line length limits
- update the bootstrap regression assertion for ansible_facts

* fix(pre-commit): install shellcheck for host architecture

- install shellcheck-py from PyPI in the local hook environment
- pin the platform-aware shellcheck package version

---------

Co-authored-by: Timothy Stewart <timothystewart6@gmail.com>
This commit is contained in:
FedelloandTimothy Stewart authored and GitHub committed 2026-09-21 17:04:30 +00:00
1 parent ee3a4a126e
commit 8fb1e26c63
15 files changed
+68 -49

No files matched your search

+9 -9
View File
@@ -29,7 +29,7 @@
- name: Set SELinux to disabled state
ansible.posix.selinux:
state: disabled
when: ansible_os_family == "RedHat"
when: ansible_facts.os_family == "RedHat"
- name: Enable IPv4 forwarding
ansible.posix.sysctl:
@@ -63,7 +63,7 @@
executable: /bin/bash
register: br_netfilter_exists
changed_when: false
when: ansible_os_family == "RedHat"
when: ansible_facts.os_family == "RedHat"
tags: sysctl
- name: Install kernel-modules-extra if br_netfilter missing
@@ -73,7 +73,7 @@
update_cache: true
register: kernel_modules_installed
when:
- ansible_os_family == "RedHat"
- ansible_facts.os_family == "RedHat"
- br_netfilter_exists.stdout | int == 0
- name: Reboot node if kernel modules package was installed
@@ -81,7 +81,7 @@
msg: "Rebooting to apply new kernel modules package"
reboot_timeout: 300
when:
- ansible_os_family == "RedHat"
- ansible_facts.os_family == "RedHat"
- kernel_modules_installed is changed
- name: Add br_netfilter to /etc/modules-load.d/
@@ -89,13 +89,13 @@
content: br_netfilter
dest: /etc/modules-load.d/br_netfilter.conf
mode: u=rw,g=,o=
when: ansible_os_family == "RedHat"
when: ansible_facts.os_family == "RedHat"
- name: Load br_netfilter
community.general.modprobe:
name: br_netfilter
state: present
when: ansible_os_family == "RedHat"
when: ansible_facts.os_family == "RedHat"
- name: Set bridge-nf-call-iptables (just to be sure)
ansible.posix.sysctl:
@@ -103,7 +103,7 @@
value: "1"
state: present
reload: true
when: ansible_os_family == "RedHat"
when: ansible_facts.os_family == "RedHat"
loop:
- net.bridge.bridge-nf-call-iptables
- net.bridge.bridge-nf-call-ip6tables
@@ -111,10 +111,10 @@
- name: Add /usr/local/bin to sudo secure_path
ansible.builtin.lineinfile:
line: Defaults secure_path = {{ secure_path[ansible_os_family] }}
line: Defaults secure_path = {{ secure_path[ansible_facts.os_family] }}
regexp: Defaults(\s)*secure_path(\s)*=
state: present
insertafter: EOF
path: /etc/sudoers
validate: visudo -cf %s
when: ansible_os_family in [ "RedHat", "Suse" ]
when: ansible_facts.os_family in [ "RedHat", "Suse" ]