Skip to content

Commit

Permalink
Cleanup expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-antoniak committed Sep 19, 2024
1 parent 36d4a49 commit 4465e70
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ansible/tasks/install_docker_ansible_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
- package_list: [ 'curl', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools' ]
when: install_packages | bool

# On Ubuntu 22 and below, install docker-py package using pip.
# On Ubuntu 24 and above, use apt-get.

- name: Uninstall incompatible Docker-py Module
become: no
pip:
name: docker-py
state: absent
vars:
ansible_python_interpreter: python3
when: ansible_distribution_major_version != "24"
when: ansible_distribution_major_version | int < 24

- name: Install Docker Module for Python Pip
pip:
name: docker
version: 2.7.0
vars:
ansible_python_interpreter: python3
when: ansible_distribution_major_version != "24"
when: ansible_distribution_major_version | int < 24

- name: Install Docker Module for Python Apt
apt:
name: python3-docker
state: present
when: ansible_distribution_major_version == "24"
when: ansible_distribution_major_version | int >= 24

0 comments on commit 4465e70

Please sign in to comment.