From 0e2baf97d25089a1d6d35e070934803adaee4422 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 15 Aug 2024 13:28:02 +0100 Subject: [PATCH] Allow mcapi proxy git sources and python package versions to be overridden This code is updated to have overrides similar to many other service roles in openstack-ansible. Change-Id: I4fc16b27dacd4ab40269cde1371e70255a4e2ced --- mcapi_vexxhost/roles/proxy/defaults/main.yml | 26 ++++++++++++++++++++ mcapi_vexxhost/roles/proxy/tasks/main.yml | 12 +++------ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 mcapi_vexxhost/roles/proxy/defaults/main.yml diff --git a/mcapi_vexxhost/roles/proxy/defaults/main.yml b/mcapi_vexxhost/roles/proxy/defaults/main.yml new file mode 100644 index 00000000..f5034f9a --- /dev/null +++ b/mcapi_vexxhost/roles/proxy/defaults/main.yml @@ -0,0 +1,26 @@ +--- +# Copyright 2024, BBC R&D +# +# 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. + +mcapi_vexxhost_proxy_upper_constraints_url: >- + {{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }} +macpi_vexxhost_proxy_git_constraints: + - "--constraint {{ mcapi_vexxhost_proxy_upper_constraints_url }}" + +mcapi_vexxhost_proxy_install_branch: main +mcapi_vexxhost_proxy_git_repo: "{{ openstack_github_base_url | default('https://github.com') ~ '/vexxhost/magnum-cluster-api' }}" + +mcapi_vexxhost_proxy_pip_packages: + - "{{ 'git+' ~ mcapi_vexxhost_proxy_git_repo ~ '@' ~ mcapi_vexxhost_proxy_install_branch ~ '#egg=magnum-cluster-api' }}" + diff --git a/mcapi_vexxhost/roles/proxy/tasks/main.yml b/mcapi_vexxhost/roles/proxy/tasks/main.yml index 6d06af5a..7a59dde6 100644 --- a/mcapi_vexxhost/roles/proxy/tasks/main.yml +++ b/mcapi_vexxhost/roles/proxy/tasks/main.yml @@ -18,17 +18,13 @@ import_role: name: "python_venv_build" vars: - _upper_constraints_url: "{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}" - _git_constraints: - - "--constraint {{ _upper_constraints_url }}" venv_python_executable: "{{ openstack_venv_python_executable | default('python3') }}" - venv_build_constraints: "{{ _git_constraints }}" + venv_build_constraints: "{{ macpi_vexxhost_proxy_git_constraints }}" venv_install_destination_path: "{{ _bin | dirname }}" - #venv_install_distro_package_list: - # - haproxy # this will be there for free on the host in an AIO + venv_install_distro_package_list: + - haproxy venv_pip_install_args: "{{ pip_install_options | default('') }}" - venv_pip_packages: - - git+https://github.com/vexxhost/magnum-cluster-api@main#egg=magnum-cluster-api + venv_pip_packages: "{{ mcapi_vexxhost_proxy_pip_packages }}" # create user and group - name: Create the magnum_cluster_api_proxy system group