diff --git a/defaults/main.yml b/defaults/main.yml index 28b65e4..c2ce131 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,6 +25,10 @@ # Optional variables # +# Distribution packages which must be installed +# on all hosts when building python wheels. +venv_build_base_distro_package_list: "{{ _venv_build_base_distro_package_list[ansible_os_family | lower] }}" + # Distribution packages which must be installed # on the host for the purpose of building the # python wheels. diff --git a/tasks/python_venv_install.yml b/tasks/python_venv_install.yml index 92f7857..89fd798 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_host != inventory_hostname) | ternary(venv_install_distro_package_list, venv_build_distro_package_list + venv_install_distro_package_list) }}" + name: "{{ (venv_build_host != inventory_hostname) | ternary(venv_install_distro_package_list, (venv_build_base_distro_package_list + venv_build_distro_package_list + venv_install_distro_package_list) | unique) }}" 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 1ba44ea..b5c90f0 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 }}" + name: "{{ (venv_build_base_distro_package_list + venv_build_distro_package_list) | unique }}" 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/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..46adf9c --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,33 @@ +--- +# Copyright 2018, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +_venv_build_base_distro_package_list: + debian: + - cmake + - gcc + - "{{ (venv_python_executable == 'python2') | ternary('pkg-config', 'python3-pkgconfig') }}" + - "{{ (venv_python_executable == 'python2') | ternary('python-dev', 'python3-dev') }}" + redhat: + - autoconf + - cmake + - gcc + - gcc-c++ + - "{{ (venv_python_executable == 'python2') | ternary('python2-devel', 'python3-devel') }}" + suse: + - autoconf + - cmake + - gcc + - gcc-c++ + - "{{ (venv_python_executable == 'python2') | ternary('python-devel', 'python3-devel') }}"