mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2026-10-23 04:12:03 +02:00
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:
1 parent
ee3a4a126e
commit
8fb1e26c63
15 files changed
+68
-49
No files matched your search
@@ -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" ]
|
||||
Reference in new issue
Block a user