From d3bea1b6ca32979f8350ae4f088febaa2204f0e8 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Thu, 6 Apr 2023 21:21:22 +0200 Subject: [PATCH] moved package declaration to variable or installing python and pip --- tasks/prerequisites.yml | 8 +------- vars/main.yml | 9 +++++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tasks/prerequisites.yml b/tasks/prerequisites.yml index 36ac285..e9b74b2 100644 --- a/tasks/prerequisites.yml +++ b/tasks/prerequisites.yml @@ -4,13 +4,7 @@ ansible.builtin.include_role: name: ednxzu.manage_apt_packages vars: - manage_apt_packages_list: - - name: "{{ manage_pip_packages_python3_package_name }}" - version: latest - state: present - - name: "{{ manage_pip_packages_pip3_package_name }}" - version: latest - state: present + manage_apt_packages_list: "{{ manage_pip_packages_required_packages }}" - name: "Update pip to latest" ansible.builtin.pip: diff --git a/vars/main.yml b/vars/main.yml index 61614e9..5c50282 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,4 +1,9 @@ --- # vars file for manage_pip_packages -manage_pip_packages_python3_package_name: python3 -manage_pip_packages_pip3_package_name: python3-pip +manage_pip_packages_required_packages: + - name: python3 + version: latest + state: present + - name: python3-pip + version: latest + state: present