Refactor installation of libpython for debian/ubuntu

Previously this required a separate vars file for each OS release to
install the correct version of libpython. This change moves to a single
vars file and uses a dictionary to look up the libpython package name
based on the OS distribution release.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/838762
Change-Id: I876339092fc3e68e0fb526e8093851d1de3ff73a
This commit is contained in:
Jonathan Rosser 2022-04-21 08:03:55 +01:00
parent de791427dc
commit 6925998659
4 changed files with 7 additions and 79 deletions

View File

@ -1,26 +0,0 @@
---
# Copyright 2019, VEXXHOST, 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.
## APT Cache options
cache_timeout: 600
uwsgi_bin: '/usr/bin'
uwsgi_distro_packages:
- libpython3.7
- uwsgi
- uwsgi-plugin-python3
_uwsgi_env: "REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt"

View File

@ -18,8 +18,14 @@ cache_timeout: 600
uwsgi_bin: '/usr/bin'
_uwsgi_distro_libpython:
buster: libpython3.7
bullseye: libpython3.9
focal: libpython3.8
jammy: libpython3.10
uwsgi_distro_packages:
- libpython3.9
- "{{ _uwsgi_distro_libpython[ansible_facts['distribution_release'] | lower] }}"
- uwsgi
- uwsgi-plugin-python3

View File

@ -1,26 +0,0 @@
---
# Copyright 2019, VEXXHOST, 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.
## APT Cache options
cache_timeout: 600
uwsgi_bin: '/usr/bin'
uwsgi_distro_packages:
- libpython3.6
- uwsgi
- uwsgi-plugin-python3
_uwsgi_env: "REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt"

View File

@ -1,26 +0,0 @@
---
# Copyright 2019, VEXXHOST, 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.
## APT Cache options
cache_timeout: 600
uwsgi_bin: '/usr/bin'
uwsgi_distro_packages:
- libpython3.8
- uwsgi
- uwsgi-plugin-python3
_uwsgi_env: "REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt"