Skip to content

Commit

Permalink
Fixed #135
Browse files Browse the repository at this point in the history
  • Loading branch information
haxorof committed Feb 21, 2021
1 parent f806963 commit 4704887
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ docker_stack: false
docker_additional_packages_pip: []
# Additional OS packages to install after Docker is configured and started.
docker_additional_packages_os: []
# Ensure PiP is upgraded before further use.
# IMPORTANT! Be carful to set this because it might cause dependecy problems.
# Forces a PiP upgraded before further use.
# IMPORTANT! Be carful to set this because it might cause dependency problems.
docker_pip_upgrade: false
# This variable is used when docker_pip_upgrade is true to upgrade/reinstall pip.
# Override if you want older version than latest during upgrade, e.g. pip==19.3.1
Expand All @@ -146,6 +146,10 @@ docker_x_fix_no_zipp_module: true
# Workaround for - No module named shutil_get_terminal_size
# https://github.com/haxorof/ansible-role-docker-ce/issues/121
docker_x_shutil_get_terminal_size: true
# Experimental - ensure that PiP is not upgraded automatically
# Setting this to true will break installation of some parts
# e.g. Python based docker-compose.
docker_x_skip_pip_auto_upgrade: false

################################################################################
# Docker removal configuration
Expand Down
3 changes: 3 additions & 0 deletions tasks/postinstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@
docker_pip_upgrade: true
when:
- docker_x_fix_no_zipp_module
- not docker_x_skip_pip_auto_upgrade | bool
- (_pip_version.stdout_lines[0] | regex_replace('^pip\s(\d+\.\d+).+$', '\\1')) is version('9.0', '<')

- name: Set PiP to be upgraded due to Rust depencency for cryptography
set_fact:
docker_pip_upgrade: true
when:
- _docker_python3 | bool
- not docker_x_skip_pip_auto_upgrade | bool
- (_pip_version.stdout_lines[0] | regex_replace('^pip\s(\d+\.\d+).+$', '\\1')) is version('21.0', '<')
when:
- _pip_version is defined
Expand All @@ -143,6 +145,7 @@
docker_pip_package_pip: "{{ docker_pip_package_pip }}<21"
when:
- (not _docker_python3 | bool) or (_docker_os_dist == "Ubuntu" and _docker_os_dist_major_version | int < 18)
- not docker_x_skip_pip_auto_upgrade | bool
- docker_pip_upgrade | bool

- name: Upgrade/Reinstall PiP
Expand Down

0 comments on commit 4704887

Please sign in to comment.