From 70525a7fbb0b92fef0593f4848fafe36c4b92d10 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 18 Oct 2018 06:57:19 +0100 Subject: [PATCH] Only install the appropriate distro packages Currently all packages provided to the role (build and install) are installed on both the build host and the install host. This was done as a temporary measure to allow us time to ensure that each role seperates these, but now that there are some installations using this it's causing conflicts in services and packages. We should rather do the right thing, and fix the roles which need the packages separated. If there is no wheel build host, the venv_build_distro_package_list packages will need to be installed on the target host, otherwise the sdist install will not work, so we cater for that in this patch too. Depends-On: https://review.openstack.org/612704 Depends-On: https://review.openstack.org/613256 Change-Id: I04100a1073dddb06775d8583104bfd6ef4b3213a --- defaults/main.yml | 3 ++- tasks/python_venv_install.yml | 2 +- tasks/python_venv_wheel_build.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ea99218..28b65e4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -26,7 +26,8 @@ # # Distribution packages which must be installed -# on the host for the purpose of building the venv. +# on the host for the purpose of building the +# python wheels. venv_build_distro_package_list: [] # Distribution packages which must be installed diff --git a/tasks/python_venv_install.yml b/tasks/python_venv_install.yml index b2d48ad..92f7857 100644 --- a/tasks/python_venv_install.yml +++ b/tasks/python_venv_install.yml @@ -20,7 +20,7 @@ - name: Install distro packages for venv build package: - name: "{{ venv_build_distro_package_list + venv_install_distro_package_list }}" + name: "{{ (venv_build_host != inventory_hostname) | ternary(venv_install_distro_package_list, venv_build_distro_package_list + venv_install_distro_package_list) }}" state: "{{ venv_distro_package_state }}" update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(venv_distro_cache_valid_time, omit) }}" diff --git a/tasks/python_venv_wheel_build.yml b/tasks/python_venv_wheel_build.yml index e06c3d5..97d7529 100644 --- a/tasks/python_venv_wheel_build.yml +++ b/tasks/python_venv_wheel_build.yml @@ -21,7 +21,7 @@ block: - name: Install distro packages for wheel build package: - name: "{{ venv_build_distro_package_list + venv_install_distro_package_list }}" + name: "{{ venv_build_distro_package_list }}" state: "{{ venv_distro_package_state }}" update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(venv_distro_cache_valid_time, omit) }}"