-
Notifications
You must be signed in to change notification settings - Fork 23
Kolla-Ansible/Kayobe version enforcement #1551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c2f6154
Check Kayobe version playbook
assumptionsandg 41dcf36
Fix pipefail
assumptionsandg 0ecaf9f
Ignore linter
assumptionsandg 7715802
Include tag option
assumptionsandg bcfbf89
Hook for overcloud host upgrade
assumptionsandg 3169db8
Check on control host upgrade
assumptionsandg c30f721
Include remaining hooks
assumptionsandg ceeacc3
Clarify fail message for unexpected current versions
assumptionsandg 10d27b9
Kolla-Ansible version check playbook
assumptionsandg 88dba74
Add pip 24 precheck
assumptionsandg c46cec9
Kolla-Ansible check hooks
assumptionsandg 303de54
Merge branch 'check-kolla-version' into check-kayobe-version
assumptionsandg ef48b1d
service upgrade hook
assumptionsandg 63b6848
s/latest/expected/g
assumptionsandg f62fc47
Merge branch 'check-kolla-version' into check-kayobe-version
assumptionsandg dd8f122
Fixup Reno
assumptionsandg 7c534cc
Add hook for host configure
assumptionsandg d1136a0
Include option to skip in config
assumptionsandg 9e8980c
Make linter happy
assumptionsandg 24a005e
Ensure commit hash is not empty
assumptionsandg ee2e249
Update links
assumptionsandg f4f7ff0
Fix playbook lint
assumptionsandg e39dbba
Merge branch 'stackhpc/2024.1' into check-kayobe-version
assumptionsandg a5f0ab8
Merge branch 'stackhpc/2024.1' into check-kayobe-version
assumptionsandg d2609c3
Apply suggestions from code review
assumptionsandg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assumptionsandg marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
- name: Check Kayobe version | ||
tags: kayobe-version-check | ||
hosts: localhost | ||
gather_facts: false | ||
vars: | ||
requirements_path: "{{ kayobe_config_path }}/../../requirements.txt" | ||
tasks: | ||
- name: Check version | ||
when: stackhpc_enable_kayobe_check | ||
block: | ||
- name: Get package info | ||
community.general.pip_package_info: | ||
register: packages | ||
|
||
- name: Check if pip is version 24.0 or newer | ||
ansible.builtin.assert: | ||
that: "{{ packages.packages.pip.pip[0].version is version('24.0', '>=') }}" | ||
fail_msg: | | ||
Pip must be 24.0 or newer to run this check. Upgrade pip by running | ||
pip install -U pip and reinstall Kayobe by running: | ||
pip install --force-reinstall -r {{ requirements_path }} | ||
|
||
- name: Get installed Kayobe commit | ||
ansible.builtin.shell: | ||
cmd: set -o pipefail && pip freeze | grep kayobe | cut -d @ -f 3 | ||
executable: /usr/bin/bash | ||
register: kayobe_git_commit | ||
failed_when: kayobe_git_commit.stdout == "" | ||
|
||
- name: Clone Kayobe | ||
ansible.builtin.git: | ||
repo: https://github.com/stackhpc/kayobe.git | ||
dest: /tmp/kayobe-git | ||
version: stackhpc/{{ openstack_release }} | ||
|
||
- name: Get tag from Kayobe commit | ||
Check warning on line 37 in etc/kayobe/ansible/check-kayobe-version.yml
|
||
ansible.builtin.command: | ||
cmd: git describe --tags {{ kayobe_git_commit.stdout }} | ||
chdir: /tmp/kayobe-git | ||
register: kayobe_current_version | ||
|
||
- name: Get latest Kayobe version | ||
ansible.builtin.shell: | ||
cmd: set -o pipefail && grep -o kayobe@stackhpc\/.*$ {{ requirements_path }} | cut -d @ -f 2 | ||
executable: /usr/bin/bash | ||
register: kayobe_latest_version | ||
|
||
- name: Check installed Kayobe version is the latest | ||
ansible.builtin.assert: | ||
that: "kayobe_latest_version.stdout in kayobe_current_version.stdout" | ||
fail_msg: | | ||
Kayobe must use the expected version before continuing. | ||
|
||
Current Kayobe version: {{ kayobe_current_version.stdout }} | ||
Expected Kayobe version: {{ kayobe_latest_version.stdout }} | ||
|
||
Recreate the Kayobe environment, or install the expected version | ||
by running: pip install --force-reinstall -r {{ requirements_path }} | ||
success_msg: | | ||
Kayobe running at version: {{ kayobe_current_version.stdout }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: Check Kolla-Ansible version | ||
tags: kolla-ansible-version-check | ||
hosts: localhost | ||
gather_facts: false | ||
tasks: | ||
- name: Check version | ||
when: stackhpc_enable_kolla_ansible_check | ||
block: | ||
- name: Get current Kolla-Ansible tag | ||
Check warning on line 10 in etc/kayobe/ansible/check-kolla-ansible-version.yml
|
||
ansible.builtin.command: | ||
cmd: git describe --tags | ||
chdir: "{{ lookup('ansible.builtin.env', 'KOLLA_SOURCE_PATH') }}" | ||
register: kolla_ansible_current_version | ||
|
||
- name: Check installed Kolla-Ansible version is the expected version | ||
ansible.builtin.assert: | ||
that: "stackhpc_kolla_ansible_source_version in kolla_ansible_current_version.stdout" | ||
fail_msg: | | ||
Kolla-Ansible must use the expected version before continuing. | ||
|
||
Current Kolla-Ansible version: {{ kolla_ansible_current_version.stdout }} | ||
Expected Kolla-Ansible version: {{ stackhpc_kolla_ansible_source_version }} | ||
|
||
Upgrade Kolla-Ansible by running: kayobe control host upgrade | ||
success_msg: | | ||
Kolla-Ansible running at version: {{ kolla_ansible_current_version.stdout }} |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/control-host-bootstrap/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/control-host-upgrade/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/infra-vm-host-configure/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/infra-vm-host-configure/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/infra-vm-service-deploy/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/infra-vm-service-deploy/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-host-configure/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-host-configure/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-host-upgrade/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-host-upgrade/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-service-deploy/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-service-deploy/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-service-reconfigure/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-service-reconfigure/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-service-upgrade/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/overcloud-service-upgrade/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/seed-host-configure/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/seed-host-configure/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/seed-hypervisor-host-configure/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/seed-hypervisor-host-configure/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/seed-service-deploy/pre.d/check-kayobe-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kayobe-version.yml |
1 change: 1 addition & 0 deletions
1
etc/kayobe/hooks/seed-service-deploy/pre.d/check-kolla-ansible-version.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ansible/check-kolla-ansible-version.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
releasenotes/notes/kolla-kayobe-version-check-f44d43c9c34d1b89.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
features: | ||
- | | ||
Ansible playbooks to check the installed Kayobe/Kolla-Ansible versions | ||
with the expected versions in Kayobe configuration. These checks | ||
will run on Kayobe bootstrap, host and service operations. | ||
assumptionsandg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
upgrade: | ||
- | | ||
Checks are enabled by default which may break existing deployments using | ||
custom forks or branches for Kayobe and Kolla-Ansible, to disable version | ||
checks in configuration set ``stackhpc_enable_kayobe_check`` and | ||
``stackhpc_enable_kolla_ansible_check`` to false | ||
assumptionsandg marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.