chore: migrate bare ansible_* facts to ansible_facts[] syntax
Some checks failed
ci/woodpecker/push/linting Pipeline failed

This commit is contained in:
Simon Cornet 2026-05-19 09:19:08 +02:00
commit 691ca56904
2 changed files with 7 additions and 7 deletions

View file

@ -2,12 +2,12 @@
# load variables and collect version information
- name: "include vars and collect versions"
when: "ansible_os_family not in 'Alpine'"
when: "ansible_facts['os_family'] not in 'Alpine'"
block:
# load os specific variables
- name: "include os specific vars"
ansible.builtin.include_vars: "{{ ansible_os_family }}.yaml"
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
# collect zabbix-agent2 version information
- name: "collect version information"
@ -22,4 +22,4 @@
# zabbix-agent prerequisites
- name: "zabbix-agent prerequisites"
ansible.builtin.import_tasks: "prerequisites.yaml"
when: "ansible_os_family not in 'Alpine'"
when: "ansible_facts['os_family'] not in 'Alpine'"

View file

@ -7,7 +7,7 @@
# install repository - debian
- name: "install repository"
when: 'ansible_os_family == "Debian"'
when: 'ansible_facts["os_family"] == "Debian"'
block:
- name: "remove old zabbix-release"
@ -18,7 +18,7 @@
- name: "install zabbix-release"
ansible.builtin.apt:
deb: "{{ zabbix_repo_url[ansible_distribution][ansible_distribution_major_version | int] }}"
deb: "{{ zabbix_repo_url[ansible_facts['distribution']][ansible_facts['distribution_major_version'] | int] }}"
state: "present"
force: true
@ -29,7 +29,7 @@
# install repository - suse
- name: "install repository"
when: 'ansible_os_family == "Suse"'
when: 'ansible_facts["os_family"] == "Suse"'
block:
- name: "remove old zabbix-release"
@ -39,7 +39,7 @@
- name: "install zabbix-release"
ansible.builtin.zypper:
name: "{{ zabbix_repo_url[ansible_distribution_major_version | int] }}"
name: "{{ zabbix_repo_url[ansible_facts['distribution_major_version'] | int] }}"
state: "present"
disable_recommends: false
nosignature: true