chore: migrate bare ansible_* facts to ansible_facts[] syntax
All checks were successful
ci/woodpecker/push/linting Pipeline was successful

This commit is contained in:
Simon Cornet 2026-05-19 09:19:07 +02:00
commit ca0d331181
3 changed files with 9 additions and 9 deletions

View file

@ -11,5 +11,5 @@
- name: "import alpine upgrade tasks" - name: "import alpine upgrade tasks"
ansible.builtin.import_tasks: "tasks/alpine323.yaml" ansible.builtin.import_tasks: "tasks/alpine323.yaml"
when: when:
- "ansible_distribution == 'Alpine'" - "ansible_facts['distribution'] == 'Alpine'"
- "'3.22' in ansible_distribution_version" - "'3.22' in ansible_facts['distribution_version']"

View file

@ -3,8 +3,8 @@
# these set of tasks will upgrade Alpine from v3.22 to v3.23 # these set of tasks will upgrade Alpine from v3.22 to v3.23
- name: "upgrade to alpine v3.23" - name: "upgrade to alpine v3.23"
when: when:
- "ansible_distribution == 'Alpine'" - "ansible_facts['distribution'] == 'Alpine'"
- "'3.22' in ansible_distribution_version" - "'3.22' in ansible_facts['distribution_version']"
block: block:
# change repositories # change repositories
@ -52,7 +52,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: "fstrim /" cmd: "fstrim /"
changed_when: false changed_when: false
when: "ansible_virtualization_type == 'kvm'" when: "ansible_facts['virtualization_type'] == 'kvm'"
# all is done # all is done
- name: "all is done" - name: "all is done"

View file

@ -9,7 +9,7 @@
# install updates - alpine # install updates - alpine
- name: "install updates - alpine" - name: "install updates - alpine"
when: 'ansible_os_family == "Alpine"' when: 'ansible_facts["os_family"] == "Alpine"'
block: block:
# install updates # install updates
@ -27,7 +27,7 @@
# install updates - debian # install updates - debian
- name: "install updates - debian" - name: "install updates - debian"
when: 'ansible_os_family == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
block: block:
# install updates # install updates
@ -46,7 +46,7 @@
# install updates - rhel # install updates - rhel
- name: "install updates - rhel" - name: "install updates - rhel"
when: 'ansible_os_family == "RedHat"' when: 'ansible_facts["os_family"] == "RedHat"'
block: block:
# install updates # install updates
@ -70,7 +70,7 @@
# install updates - suse # install updates - suse
- name: "install updates" - name: "install updates"
when: 'ansible_os_family == "Suse"' when: 'ansible_facts["os_family"] == "Suse"'
block: block:
# install updates # install updates