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
This commit is contained in:
Jesse Pretorius 2018-10-18 06:57:19 +01:00
parent 62e5f11b17
commit 70525a7fbb
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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) }}"

View File

@ -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) }}"