From 73063732aa297cf4fc3441270b7d66685557ef22 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 12 Apr 2019 14:12:48 +0100 Subject: [PATCH] Add openstack_release and openstack_branch Adds two new variables, 'openstack_release' and 'openstack_branch', in ${KAYOBE_CONFIG_PATH}/openstack.yml for setting the current OpenStack release and branch in a single place. Also uses the master branch for the molecule tox job. Change-Id: I851a1e6eddc6738005c1813599445b38c0ae0d57 --- ansible/group_vars/all/bifrost | 5 +++-- ansible/group_vars/all/ipa | 13 +++++++++---- ansible/group_vars/all/kolla | 13 +++++++------ ansible/group_vars/all/openstack | 10 ++++++++++ etc/kayobe/bifrost.yml | 3 ++- etc/kayobe/ipa.yml | 6 +++++- etc/kayobe/kolla.yml | 5 +++-- etc/kayobe/openstack.yml | 13 +++++++++++++ .../notes/openstack-branch-87df0c2f647037c0.yaml | 6 ++++++ tox.ini | 5 +---- 10 files changed, 59 insertions(+), 20 deletions(-) create mode 100644 etc/kayobe/openstack.yml create mode 100644 releasenotes/notes/openstack-branch-87df0c2f647037c0.yaml diff --git a/ansible/group_vars/all/bifrost b/ansible/group_vars/all/bifrost index fe95cc225..b3dfc3472 100644 --- a/ansible/group_vars/all/bifrost +++ b/ansible/group_vars/all/bifrost @@ -7,8 +7,9 @@ # URL of Bifrost source code repository. kolla_bifrost_source_url: "https://git.openstack.org/openstack/bifrost" -# Version (branch, tag, etc.) of Bifrost source code repository. -kolla_bifrost_source_version: "master" +# Version (branch, tag, etc.) of Bifrost source code repository. Default is +# {{ openstack_branch }}. +kolla_bifrost_source_version: "{{ openstack_branch }}" ############################################################################### # Diskimage-builder configuration. diff --git a/ansible/group_vars/all/ipa b/ansible/group_vars/all/ipa index 7a473e39c..e055710d7 100644 --- a/ansible/group_vars/all/ipa +++ b/ansible/group_vars/all/ipa @@ -10,8 +10,8 @@ ipa_build_images: False # URL of IPA source repository. ipa_build_source_url: "https://git.openstack.org/openstack/ironic-python-agent" -# Version of IPA source repository. -ipa_build_source_version: "master" +# Version of IPA source repository. Default is {{ openstack_branch }}. +ipa_build_source_version: "{{ openstack_branch }}" # URL of IPA upper constraints file. ipa_build_upper_constraints_file_url: @@ -59,11 +59,16 @@ ipa_build_dib_git_elements: [] ############################################################################### # Ironic Python Agent (IPA) images configuration. +# Suffix of upstream Ironic deployment image files. Default is based on +# {{ openstack_branch }}. +ipa_images_upstream_url_suffix: >- + {% if openstack_branch != 'master' %}-{{ openstack_branch | replace('/', '-') }}{% endif %} + # Name of Ironic deployment kernel image to register in Glance. ipa_images_kernel_name: "ipa.vmlinuz" # URL of Ironic deployment kernel image to download. -ipa_kernel_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz" +ipa_kernel_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe{{ ipa_images_upstream_url_suffix }}.vmlinuz" # URL of checksum of Ironic deployment kernel image. ipa_kernel_checksum_url: "{{ ipa_kernel_upstream_url }}.{{ ipa_kernel_checksum_algorithm }}" @@ -75,7 +80,7 @@ ipa_kernel_checksum_algorithm: "sha256" ipa_images_ramdisk_name: "ipa.initramfs" # URL of Ironic deployment ramdisk image to download. -ipa_ramdisk_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz" +ipa_ramdisk_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem{{ ipa_images_upstream_url_suffix }}.cpio.gz" # URL of checksum of Ironic deployment ramdisk image. ipa_ramdisk_checksum_url: "{{ ipa_ramdisk_upstream_url }}.{{ ipa_ramdisk_checksum_algorithm }}" diff --git a/ansible/group_vars/all/kolla b/ansible/group_vars/all/kolla index 0604593c8..9809b5366 100644 --- a/ansible/group_vars/all/kolla +++ b/ansible/group_vars/all/kolla @@ -12,8 +12,8 @@ kolla_source_path: "{{ source_checkout_path ~ '/kolla' }}" kolla_source_url: "https://git.openstack.org/openstack/kolla" # Version (branch, tag, etc.) of Kolla source code repository if type is -# 'source'. -kolla_source_version: "master" +# 'source'. Default is {{ openstack_branch }}. +kolla_source_version: "{{ openstack_branch }}" # Path to virtualenv in which to install kolla. kolla_venv: "{{ virtualenv_path ~ '/kolla' }}" @@ -34,8 +34,8 @@ kolla_ansible_source_path: "{{ lookup('env', 'KOLLA_SOURCE_PATH') | default(look kolla_ansible_source_url: "https://git.openstack.org/openstack/kolla-ansible" # Version (branch, tag, etc.) of Kolla Ansible source code repository if type -# is 'source'. -kolla_ansible_source_version: "master" +# is 'source'. Default is {{ openstack_branch }}. +kolla_ansible_source_version: "{{ openstack_branch }}" # Path to virtualenv in which to install kolla-ansible. kolla_ansible_venv: "{{ lookup('env', 'KOLLA_VENV_PATH') | default(lookup('env', 'PWD') ~ '/venvs/kolla-ansible', true) }}" @@ -71,7 +71,8 @@ kolla_docker_registry_username: kolla_docker_registry_password: # Kolla OpenStack release version. This should be a Docker image tag. -kolla_openstack_release: "master" +# Default is {{ openstack_release }}. +kolla_openstack_release: "{{ openstack_release }}" # Dict mapping names of sources to their definitions for # kolla_install_type=source. See kolla.common.config for details. @@ -313,7 +314,7 @@ kolla_enable_tls_external: "no" kolla_openstack_logging_debug: "False" # Upper constraints file for installation of Kolla. -kolla_upper_constraints_file: "https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt" +kolla_upper_constraints_file: "https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h={{ openstack_branch }}" # User account to use for Kolla SSH access. kolla_ansible_user: kolla diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index ac0d4870a..e1d61ecef 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -1,4 +1,14 @@ --- +############################################################################### +# OpenStack release configuration. + +# Name of the current OpenStack release. Default is "master". +openstack_release: "master" + +# Name of the current OpenStack branch. Default is "master". +openstack_branch: >- + {% if openstack_release != 'master' %}stable/{% endif %}{{ openstack_release | lower }} + ############################################################################### # OpenStack authentication configuration. diff --git a/etc/kayobe/bifrost.yml b/etc/kayobe/bifrost.yml index 271ebdc89..078a6ced6 100644 --- a/etc/kayobe/bifrost.yml +++ b/etc/kayobe/bifrost.yml @@ -7,7 +7,8 @@ # URL of Bifrost source code repository. #kolla_bifrost_source_url: -# Version (branch, tag, etc.) of Bifrost source code repository. +# Version (branch, tag, etc.) of Bifrost source code repository. Default is +# {{ openstack_branch }}. #kolla_bifrost_source_version: ############################################################################### diff --git a/etc/kayobe/ipa.yml b/etc/kayobe/ipa.yml index 828a8ab34..63b0499d2 100644 --- a/etc/kayobe/ipa.yml +++ b/etc/kayobe/ipa.yml @@ -10,7 +10,7 @@ # URL of IPA source repository. #ipa_build_source_url: -# Version of IPA source repository. +# Version of IPA source repository. Default is {{ openstack_branch }}. #ipa_build_source_version: # URL of IPA upper constraints file. @@ -50,6 +50,10 @@ ############################################################################### # Ironic Python Agent (IPA) images configuration. +# Suffix of upstream Ironic deployment image files. Default is based on +# {{ openstack_branch }}. +#ipa_images_upstream_url_suffix: + # Name of Ironic deployment kernel image to register in Glance. #ipa_images_kernel_name: diff --git a/etc/kayobe/kolla.yml b/etc/kayobe/kolla.yml index 42eef890b..aa3f4ffe2 100644 --- a/etc/kayobe/kolla.yml +++ b/etc/kayobe/kolla.yml @@ -14,7 +14,7 @@ #kolla_source_url: # Version (branch, tag, etc.) of Kolla source code repository if type is -# 'source'. +# 'source'. Default is {{ openstack_branch }}. #kolla_source_version: # Path to virtualenv in which to install kolla. @@ -36,7 +36,7 @@ #kolla_ansible_source_url: # Version (branch, tag, etc.) of Kolla Ansible source code repository if type -# is 'source'. +# is 'source'. Default is {{ openstack_branch }}. #kolla_ansible_source_version: # Path to virtualenv in which to install kolla-ansible. @@ -73,6 +73,7 @@ #kolla_docker_registry_password: # Kolla OpenStack release version. This should be a Docker image tag. +# Default is {{ openstack_release }}. #kolla_openstack_release: # Dict mapping names of sources to their definitions for diff --git a/etc/kayobe/openstack.yml b/etc/kayobe/openstack.yml new file mode 100644 index 000000000..1acfd0756 --- /dev/null +++ b/etc/kayobe/openstack.yml @@ -0,0 +1,13 @@ +--- +############################################################################### +# OpenStack release configuration. + +# Name of the current OpenStack release. Default is "master". +#openstack_release: + +# Name of the current OpenStack branch. Default is "master". +#openstack_branch: + +############################################################################### +# Dummy variable to allow Ansible to accept this file. +workaround_ansible_issue_8743: yes diff --git a/releasenotes/notes/openstack-branch-87df0c2f647037c0.yaml b/releasenotes/notes/openstack-branch-87df0c2f647037c0.yaml new file mode 100644 index 000000000..eb5774f89 --- /dev/null +++ b/releasenotes/notes/openstack-branch-87df0c2f647037c0.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds two new variables, ``openstack_release`` and ``openstack_branch``, in + ``${KAYOBE_CONFIG_PATH}/openstack.yml`` for setting the current OpenStack + release and branch in a single place. diff --git a/tox.ini b/tox.ini index 043d2533f..affaef9fd 100644 --- a/tox.ini +++ b/tox.ini @@ -59,11 +59,8 @@ commands = [testenv:molecule] # Molecule only supports python 2.7 and 3.6. basepython = python2 -# Use stable/rocky upper-constraints for molecule since pytest 3.10 fails with -# the following error: -# AttributeError: 'Config' object has no attribute 'cache' deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky} + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/doc/requirements.txt whitelist_externals =