Skip to content

Commit

Permalink
Fixes #102 #103
Browse files Browse the repository at this point in the history
  • Loading branch information
haxorof committed Jul 15, 2019
1 parent a4353ba commit 6a20b97
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased](../../releases/tag/X.Y.Z)

### Fixed

- Major version comparison fails for some tasks due to non-numeric value ([#103](../../issues/103))
- Docker compose fails on Debian 10 (Buster) ([#102](../../issues/102))

## [2.5.0](../../releases/tag/2.5.0) - 2019-07-14

### Added
Expand Down
2 changes: 1 addition & 1 deletion tasks/bug-tweaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
include_tasks: bug-tweaks/tweak-debian8-directlvm.yml
when:
- _docker_os_dist == "Debian"
- _docker_os_dist_major_version == '8'
- _docker_os_dist_major_version | int == 8
- docker_daemon_config['storage-opts'] is defined
- docker_daemon_config['storage-opts'] | select('match', '^dm.directlvm_device.+')
2 changes: 1 addition & 1 deletion tasks/checks/compatibility-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
this role on a host running Debian Wheezy.
when:
- _docker_os_dist == "Debian"
- _docker_os_dist_major_version == '7'
- _docker_os_dist_major_version | int == 7
- docker_stack | bool or
docker_sdk | bool or
docker_pip_upgrade | bool or
Expand Down
2 changes: 1 addition & 1 deletion tasks/configure-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
state: present
register: _pkg_result
until: _pkg_result is succeeded
when: (_docker_os_dist == "Ubuntu" or (_docker_os_dist == "Debian" and _docker_os_dist_major_version > '7'))
when: (_docker_os_dist == "Ubuntu" or (_docker_os_dist == "Debian" and _docker_os_dist_major_version | int > 7))
when:
- docker_daemon_config['storage-driver'] is defined
- docker_daemon_config['storage-driver'] == 'devicemapper'
Expand Down
29 changes: 27 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@
set_fact:
_docker_os_dist: "Ubuntu"
_docker_os_dist_release: "xenial"
_docker_os_dist_major_version: "16"
_docker_os_dist_major_version: 16
when:
_docker_os_dist == "Linux Mint" and
_docker_os_dist_major_version == "18"
_docker_os_dist_major_version | int == 18
tags: ["always"]

- name: Reinterpret distribution facts for Debian 10 (Buster) due to bug
set_fact:
_docker_os_dist: "Debian"
_docker_os_dist_release: "buster"
_docker_os_dist_major_version: 10
when:
- _docker_os_dist == "Debian"
- _docker_os_dist_release == "buster" or (ansible_lsb is defined
and ansible_lsb.codename is defined and ansible_lsb.codename == "buster")
tags: ["always"]

- name: OS release info
Expand All @@ -26,6 +37,20 @@
register: _docker_os_release_info
tags: ["always"]

- name: Print OS release information
debug:
var: _docker_os_release_info
verbosity: 1
tags: ["always"]

- name: Print LSB information
debug:
var: ansible_lsb
verbosity: 1
when:
- ansible_lsb is defined
tags: ["always"]

- name: Reinterpret distribution facts for Raspbian
set_fact:
_docker_os_arch: "armhf"
Expand Down
12 changes: 11 additions & 1 deletion tasks/postinstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,17 @@
- _docker_additional_packages_pip | length > 0
- _docker_pip_cmd.rc != 0
- _docker_os_dist == "Debian"
- _docker_os_dist_major_version == '8'
- _docker_os_dist_major_version | int == 8

- name: Ensure python-backports.ssl-match-hostname is present (Debian 10)
set_fact:
_docker_additional_packages_os: "{{ _docker_additional_packages_os + ['python-backports.ssl-match-hostname'] }}"
when:
- not _docker_python3 | bool
- _docker_additional_packages_pip | length > 0
- _docker_pip_cmd.rc != 0
- _docker_os_dist == "Debian"
- _docker_os_dist_major_version | int == 10

- name: Ensure EPEL release repository is installed
become: true
Expand Down
39 changes: 26 additions & 13 deletions tasks/setup-repository-Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
---
- name: Update APT cache
become: true
apt:
update_cache: yes
changed_when: false
register: _pkg_result
until: _pkg_result is succeeded
when:
- docker_network_access | bool
- name: Update APT cache block
block:
- name: Update APT cache
become: true
apt:
update_cache: yes
changed_when: false
register: _pkg_result
until: _pkg_result is succeeded
when:
- docker_network_access | bool
rescue:
- name: Retry APT cache update with allow-releaseinfo-change
become: true
command: apt-get update --allow-releaseinfo-change
args:
warn: false
changed_when: false
register: _pkg_result
until: _pkg_result is succeeded
when:
- docker_network_access | bool

- name: Ensure packages are installed for repository setup
become: true
Expand All @@ -29,8 +42,8 @@
until: _pkg_result is succeeded
when:
- docker_network_access | bool
- (_docker_os_dist == "Ubuntu" and _docker_os_dist_major_version > 14) or
(_docker_os_dist == "Debian" and _docker_os_dist_major_version > 7)
- (_docker_os_dist == "Ubuntu" and _docker_os_dist_major_version | int > 14) or
(_docker_os_dist == "Debian" and _docker_os_dist_major_version | int > 7)

- name: Add Docker APT key (alternative for older Ubuntu systems without SNI).
become: true
Expand All @@ -40,8 +53,8 @@
changed_when: false
when:
- docker_network_access | bool
- (_docker_os_dist == "Ubuntu" and _docker_os_dist_major_version == 14) or
(_docker_os_dist == "Debian" and _docker_os_dist_major_version == 7)
- (_docker_os_dist == "Ubuntu" and _docker_os_dist_major_version | int == 14) or
(_docker_os_dist == "Debian" and _docker_os_dist_major_version | int == 7)
tags:
- skip_ansible_lint

Expand Down
2 changes: 1 addition & 1 deletion tests/vagrant_boxes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible_version: "2.6.17"
ansible_version: "2.6.18"
galaxy_role_name: haxorof.docker_ce
role_dir: ansible-role-docker-ce

Expand Down

0 comments on commit 6a20b97

Please sign in to comment.