Skip to content

Commit d3d1c3e

Browse files
committed
Corrected support for Ubuntu 18.04 Bionic. Ansible due to some bug was in other role incorrectly transforming docker repository entry treating it as a regular Debian/Ubuntu repository which led to 404's
Tried this role, then debobs.logrotate - logrotate was modifying the sources.list incorrectly using Ansible native mechanism and was stopping at "Update APT cache"
1 parent fc1ff65 commit d3d1c3e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

tasks/docker.debian.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@
1212

1313
- name: Add APT key for docker repository
1414
become: yes
15-
shell: "curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -"
15+
shell: "curl -fsSL https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg | apt-key add -"
1616

1717
- name: Add repository
1818
become: yes
19-
shell: 'add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"'
19+
shell: 'echo "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} $(lsb_release -cs) stable" > /etc/apt/sources.list.d/riotkit-docker.list'
2020

2121
- name: Install docker from the download.docker.com repository
2222
become: yes
23-
apt: name="docker-ce" state=present update_cache=yes
23+
apt:
24+
name:
25+
- docker-ce
26+
- docker-ce-cli
27+
- containerd.io
28+
state: present
29+
update_cache: yes

tasks/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
- name: Install docker from main repository
2222
become: yes
2323
apt: name="docker.io" state=present update_cache=yes
24-
when: ansible_distribution != 'Debian' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool)
24+
when: ansible_distribution != 'Debian' and ansible_distribution != 'Ubuntu' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool)
2525

2626
- include: docker.debian.yml
27-
when: ansible_distribution == 'Debian' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool)
27+
when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and (docker_is_not_running.stdout|bool or enforce_docker_update|bool)
2828

2929
- name: Delete old docker-compose from package manager
3030
become: yes

0 commit comments

Comments
 (0)