From a0e77bafb3fc4b150322b8d5f3a971941ec0e672 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Tue, 29 Aug 2023 23:13:59 +0200 Subject: [PATCH] install python3-docker instead of from pip following pep668 --- molecule/default/requirements.yml | 1 - molecule/with_custom_config/requirements.yml | 1 - molecule/with_custom_config/verify.yml | 14 ++++---------- tasks/install_docker_pip.yml | 8 -------- tasks/install_python_docker.yml | 7 +++++++ tasks/main.yml | 4 ++-- vars/main.yml | 6 +++--- 7 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 tasks/install_docker_pip.yml create mode 100644 tasks/install_python_docker.yml diff --git a/molecule/default/requirements.yml b/molecule/default/requirements.yml index 03bb97b..0a4a9fb 100644 --- a/molecule/default/requirements.yml +++ b/molecule/default/requirements.yml @@ -3,4 +3,3 @@ roles: - name: ednxzu.manage_repositories - name: ednxzu.manage_apt_packages - - name: ednxzu.manage_pip_packages diff --git a/molecule/with_custom_config/requirements.yml b/molecule/with_custom_config/requirements.yml index 03bb97b..0a4a9fb 100644 --- a/molecule/with_custom_config/requirements.yml +++ b/molecule/with_custom_config/requirements.yml @@ -3,4 +3,3 @@ roles: - name: ednxzu.manage_repositories - name: ednxzu.manage_apt_packages - - name: ednxzu.manage_pip_packages diff --git a/molecule/with_custom_config/verify.yml b/molecule/with_custom_config/verify.yml index 9c36bbe..5dd3827 100644 --- a/molecule/with_custom_config/verify.yml +++ b/molecule/with_custom_config/verify.yml @@ -109,18 +109,12 @@ - name: "Test: python package docker" block: - - name: "Command pip3 list -o" - ansible.builtin.command: "pip3 list -o" + - name: "Command pip3 list" + ansible.builtin.command: "pip3 list" changed_when: false - register: pip3_list_outdated - - - name: "Command pip3 list -u" - ansible.builtin.command: "pip3 list -u" - changed_when: false - register: pip3_list_uptodate + register: pip3_list - name: "Verify python package docker" ansible.builtin.assert: that: - - "'docker' not in pip3_list_outdated.stdout" - - "'docker' in pip3_list_uptodate.stdout" + - "'docker' in pip3_list.stdout" diff --git a/tasks/install_docker_pip.yml b/tasks/install_docker_pip.yml deleted file mode 100644 index fcb4cd4..0000000 --- a/tasks/install_docker_pip.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# task/install_docker_pip file for install_docker -- name: "Install docker python packages" - ansible.builtin.include_role: - name: ednxzu.manage_pip_packages - vars: - manage_pip_packages_install_prereqs: false - manage_pip_packages_list: "{{ install_docker_pip_packages }}" diff --git a/tasks/install_python_docker.yml b/tasks/install_python_docker.yml new file mode 100644 index 0000000..afa2fe0 --- /dev/null +++ b/tasks/install_python_docker.yml @@ -0,0 +1,7 @@ +--- +# task/install_docker_pip file for install_docker +- name: "Install docker packages" + ansible.builtin.include_role: + name: ednxzu.manage_apt_packages + vars: + manage_apt_packages_list: "{{ install_docker_python_packages }}" diff --git a/tasks/main.yml b/tasks/main.yml index 58f0efc..1d56991 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -10,8 +10,8 @@ ansible.builtin.include_tasks: install_compose.yml when: install_docker_compose -- name: "Import install_docker_pip.yml" - ansible.builtin.include_tasks: install_docker_pip.yml +- name: "Import install_python_docker.yml" + ansible.builtin.include_tasks: install_python_docker.yml when: install_docker_python_packages - name: "Import configure.yml" diff --git a/vars/main.yml b/vars/main.yml index 59d6986..36e3366 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -18,9 +18,9 @@ install_docker_packages: - name: "containerd.io" version: latest state: "{% if install_docker_auto_update %}latest{% else %}present{% endif %}" -install_docker_pip_packages: - - name: docker - version_constraint: latest +install_docker_python_packages: + - name: python3-docker + version: latest state: "{% if install_docker_auto_update %}latest{% else %}present{% endif %}" install_docker_repository: - uri: "https://download.docker.com/linux/{{ ansible_distribution|lower }}"