Skip to content

Commit

Permalink
docker: add docker_python_install parameter (#1456)
Browse files Browse the repository at this point in the history
With the boolean docker_python_install parameter it is possible
to enable and disable the installation of the Python docker
bindings.

Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored May 31, 2024
1 parent f7cafac commit 171b15a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions roles/docker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ docker_packages_fail:
##########################
# python package

docker_python_install: true

docker_python3_package_name: python3-docker
docker_python_package_name: python-docker
docker_python_package_names:
Expand Down
8 changes: 6 additions & 2 deletions roles/docker/tasks/install-docker-Debian-family.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@
state: present
lock_timeout: "{{ apt_lock_timeout | default(300) }}"

when: not docker_python_install_from_pip|bool
when:
- docker_python_install | bool
- not docker_python_install_from_pip | bool

- name: Install python bindings with pip # noqa: key-order[task], osism-fqcn
become: true
Expand Down Expand Up @@ -166,7 +168,9 @@
executable: pip3
state: present

when: docker_python_install_from_pip|bool
when:
- docker_python_install | bool
- docker_python_install_from_pip | bool

- name: Install packages required by docker login
become: true
Expand Down
8 changes: 6 additions & 2 deletions roles/docker/tasks/install-docker-RedHat-family.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
name: "{{ docker_python3_package_name }}"
state: present
lock_timeout: "{{ lock_timeout | default(300) }}"
when: not docker_python_install_from_pip|bool
when:
- docker_python_install | bool
- not docker_python_install_from_pip | bool

- name: Install python bindings with pip # noqa: key-order[task], osism-fqcn
become: true
Expand All @@ -110,7 +112,9 @@
executable: pip3
state: present

when: docker_python_install_from_pip|bool
when:
- docker_python_install | bool
- docker_python_install_from_pip | bool

- name: Install packages required by docker login
become: true
Expand Down

0 comments on commit 171b15a

Please sign in to comment.