Skip to content

Commit 4465e70

Browse files
Cleanup expressions
1 parent 36d4a49 commit 4465e70

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ansible/tasks/install_docker_ansible_module.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@
44
- package_list: [ 'curl', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools' ]
55
when: install_packages | bool
66

7+
# On Ubuntu 22 and below, install docker-py package using pip.
8+
# On Ubuntu 24 and above, use apt-get.
9+
710
- name: Uninstall incompatible Docker-py Module
811
become: no
912
pip:
1013
name: docker-py
1114
state: absent
1215
vars:
1316
ansible_python_interpreter: python3
14-
when: ansible_distribution_major_version != "24"
17+
when: ansible_distribution_major_version | int < 24
1518

1619
- name: Install Docker Module for Python Pip
1720
pip:
1821
name: docker
1922
version: 2.7.0
2023
vars:
2124
ansible_python_interpreter: python3
22-
when: ansible_distribution_major_version != "24"
25+
when: ansible_distribution_major_version | int < 24
2326

2427
- name: Install Docker Module for Python Apt
2528
apt:
2629
name: python3-docker
2730
state: present
28-
when: ansible_distribution_major_version == "24"
31+
when: ansible_distribution_major_version | int >= 24

0 commit comments

Comments
 (0)