Skip to content

Commit

Permalink
Corrected support for Ubuntu 18.04 Bionic. Ansible due to some bug wa…
Browse files Browse the repository at this point in the history
…s 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"
  • Loading branch information
blackandred committed Dec 22, 2019
1 parent fc1ff65 commit d3d1c3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions tasks/docker.debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@

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

- name: Add repository
become: yes
shell: 'add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"'
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'

- name: Install docker from the download.docker.com repository
become: yes
apt: name="docker-ce" state=present update_cache=yes
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
state: present
update_cache: yes
4 changes: 2 additions & 2 deletions tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
- name: Install docker from main repository
become: yes
apt: name="docker.io" state=present update_cache=yes
when: ansible_distribution != 'Debian' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool)
when: ansible_distribution != 'Debian' and ansible_distribution != 'Ubuntu' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool)

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

- name: Delete old docker-compose from package manager
become: yes
Expand Down

0 comments on commit d3d1c3e

Please sign in to comment.