Use ansible_facts.xxx instead of ansible_xxx. (#1237)

This commit is contained in:
Felix Fontein
2026-02-07 16:00:22 +01:00
committed by GitHub
parent 14be59e7e4
commit 85a3c811cb
65 changed files with 95 additions and 95 deletions
@@ -21,12 +21,12 @@
block:
- name: Add gpg key
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
- name: Add Docker repo
ansible.builtin.apt_repository:
repo: deb [arch={{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
repo: deb [arch={{ 'arm64' if ansible_facts.architecture == 'aarch64' else 'amd64' }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_facts.distribution | lower }} {{ ansible_facts.distribution_release }} stable
state: present
- when:
@@ -35,11 +35,11 @@
name: Add Docker repo on Ubuntu 20 or before, or Debian 11 or before
block:
- name: Add gpg key
ansible.builtin.shell: curl -fsSL https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg >key && apt-key add key # noqa: command-instead-of-module
ansible.builtin.shell: curl -fsSL https://download.docker.com/linux/{{ ansible_facts.distribution | lower }}/gpg >key && apt-key add key # noqa: command-instead-of-module
- name: Add Docker repo
ansible.builtin.apt_repository:
repo: deb [arch={{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
repo: deb [arch={{ 'arm64' if ansible_facts.architecture == 'aarch64' else 'amd64' }}] https://download.docker.com/linux/{{ ansible_facts.distribution | lower }} {{ ansible_facts.distribution_release }} stable
state: present
- block: