docker: use ansible conditional for arch selection

in-line substitution is more tricky. this is a simple way to explicitly
declare the Docker apt repo string by architecture.
master
Devan Carpenter 2 years ago
parent e2bb64c3b9
commit 900945dec1
Signed by: dvn
GPG Key ID: E1707CFFD7B85A02

@ -8,11 +8,19 @@
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
url: https://download.docker.com/linux/debian/gpg
- name: Add Docker apt repo to souces.list
- name: Add arm64 Docker apt repo to souces.list
apt_repository:
codename: "{{ ansible_distribution_release }}"
repo: "deb [arch={% if {{ ansible_architecture }} == aarch64 %}arm64 {% endif %}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
repo: "deb [arch=arm64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
update_cache: yes
when: ansible_architecture == "aarch64"
- name: Add amd64 Docker apt repo to souces.list
apt_repository:
codename: "{{ ansible_distribution_release }}"
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
update_cache: yes
when: ansible_architecture == "amd64"
- name: Install Docker CE
apt:

Loading…
Cancel
Save