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:03 +02:00
commit de7900fc05
3 changed files with 8 additions and 8 deletions

View file

@ -6,5 +6,5 @@
name: "apparmor" name: "apparmor"
state: "absent" state: "absent"
purge: true purge: true
when: 'ansible_distribution == "Debian"' when: 'ansible_facts["distribution"] == "Debian"'
notify: "reboot container" notify: "reboot container"

View file

@ -2,7 +2,7 @@
# install docker - alpine # install docker - alpine
- name: "install docker - alpine" - name: "install docker - alpine"
when: "ansible_os_family == 'Alpine'" when: "ansible_facts['os_family'] == 'Alpine'"
block: block:
# install docker # install docker
@ -27,7 +27,7 @@
# install docker - debian # install docker - debian
- name: "install docker - debian" - name: "install docker - debian"
when: "ansible_os_family == 'Debian'" when: "ansible_facts['os_family'] == 'Debian'"
block: block:
# remove old docker.io packages # remove old docker.io packages
@ -54,7 +54,7 @@
# add docker gpg key # add docker gpg key
- name: "docker gpg key" - name: "docker gpg key"
ansible.builtin.get_url: ansible.builtin.get_url:
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" url: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
dest: "/etc/apt/keyrings/docker.asc" dest: "/etc/apt/keyrings/docker.asc"
mode: "0644" mode: "0644"
@ -62,10 +62,10 @@
- name: "docker repository" - name: "docker repository"
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: repo:
"deb [arch={{ ansible_architecture | replace('x86_64', 'amd64') }} \ "deb [arch={{ ansible_facts['architecture'] | replace('x86_64', 'amd64') }} \
signed-by=/etc/apt/keyrings/docker.asc] \ signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/{{ ansible_distribution | lower }} \ https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} \
{{ ansible_distribution_release }} stable" {{ ansible_facts['distribution_release'] }} stable"
state: "present" state: "present"
filename: "docker" filename: "docker"

View file

@ -4,7 +4,7 @@
# disable apparmor # disable apparmor
- name: "apparmor" - name: "apparmor"
ansible.builtin.import_tasks: "apparmor.yaml" ansible.builtin.import_tasks: "apparmor.yaml"
when: "ansible_virtualization_type == 'lxc'" when: "ansible_facts['virtualization_type'] == 'lxc'"
# flush handler # flush handler
- name: "flush handlers" - name: "flush handlers"