From 945a0ab783b1accfd63f56f1b09a85a05604e88f Mon Sep 17 00:00:00 2001 From: panda Date: Tue, 27 Dec 2022 23:33:09 +0100 Subject: [PATCH] added support for aarch64 and ubuntu release in variables --- roles/docker_host/tasks/ubuntu.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/roles/docker_host/tasks/ubuntu.yml b/roles/docker_host/tasks/ubuntu.yml index 856456b..c274323 100644 --- a/roles/docker_host/tasks/ubuntu.yml +++ b/roles/docker_host/tasks/ubuntu.yml @@ -7,14 +7,19 @@ pkg: - apt-transport-https - ca-certificates - - curl + - curl - software-properties-common - name: Add docker repo key shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - -- name: add repo for docker - shell: echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | tee /etc/apt/sources.list.d/docker.list +- name: add repo for docker for x86_64 + shell: echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list + when: ansible_architecture == 'x86_64' + +- name: add repo for docker for aarch64 + shell: echo "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list + when: ansible_architecture == 'aarch64' - name: Update repositories cache apt: @@ -45,4 +50,4 @@ shell: curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url | grep docker-compose-linux-x86_64 | grep -v sha256 | cut -d '"' -f 4 | wget -O /usr/local/bin/docker-compose -qi - - name: make compose executable - shell: chmod +x /usr/local/bin/docker-compose + shell: chmod +x /usr/local/bin/docker-compose \ No newline at end of file