[stable/train-only] Detect incorrect version of nova-libvirt

Resolves: rhbz#2119113

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I70483ebafd7b8deceb37c2968c98bf5655bc4095
This commit is contained in:
Jiri Podivin 2023-03-01 10:44:35 +01:00 committed by matbu
parent 61366bcd39
commit 467a8b1928
5 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,13 @@
---
- hosts: Compute
gather_facts: true
vars:
metadata:
name: Check correctness of installed nova-libvirt version
description: >
Detect if installed nova-libvirt satisfies constraints.
groups:
- pre-upgrade
- pre-update
roles:
- nova_libvirt_version

View File

@ -0,0 +1,41 @@
Repos
==============
An Ansible role to check the correctness of nova-libvirt version.
Requirements
------------
This role could be used before/after an Undercloud or an Overcloud has been
deployed.
Role Variables
--------------
- None
Dependencies
------------
No dependencies.
Example Playbook
----------------
- hosts: undercloud
roles:
- role: nova_libvirt
- hosts: overcloud
roles:
- role: nova_libvirt
License
-------
Apache
Author Information
------------------
Red Hat TripleO Validations Team

View File

@ -0,0 +1,3 @@
---
forbidden_version: 16.2.0-55.1638436404
nova_libvirt_container_name: nova_libvirt

View File

@ -0,0 +1,15 @@
---
- name: Container present
become: true
register: nova_libvirt_container_version
podman_container_info:
name: "{{ nova_libvirt_container_name }}"
- name: Set fact for nova_libvirt container version
set_fact:
nova_libvirt_version: "{{ nova_libvirt_container_version['containers'][0]['Config']['Image'] | default('') }}"
- name: Fail if nova-libvirt version doesn't satisfy reqs
fail:
msg: "nova-libvirt container is installed as version {{ forbidden_version }}. Which doesn't satisfy constraints"
when: forbidden_version in nova_libvirt_version

View File

@ -0,0 +1,9 @@
---
metadata:
name: Check correctness of nova-libvirt package version
description: >
Detect whether the installed nova-libvirt version satisfies
constraints.
groups:
- pre-upgrade
- pre-update