overcloud_service_status¶
About The Role¶
An Ansible role to verify the Overcloud
services states after a deployment
or an update. It checks the API /os-services
and looks for deprecated
services (nova-consoleauth
) or any down services.
Requirements¶
This role needs to be run on an Undercloud
with a deployed Overcloud
.
Dependencies¶
No dependencies.
Example Playbook¶
- hosts: undercloud
roles:
- { role: overcloud_service_status }
License¶
Apache
Full Description¶
Role Documentation¶
Welcome to the “overcloud_service_status” role documentation.
Role Defaults¶
This section highlights all of the defaults and variables set within the “overcloud_service_status” role.
# All variables intended for modification should place placed in this file.
# All variables within this role should have a prefix of "overcloud_service_status"
# Debugging mode, whether or no to log the token request
overcloud_service_status_debug: false
# Overcloud API to validate against
overcloud_service_api:
- nova
- cinderv3
# A list of services that shouldn't be registered any more
overcloud_deprecated_services:
nova:
- nova-consoleauth
# These variables are normally set as host variables for the undercloud when generating
# the inventory with tripleo-ansible-inventory:
# - overcloud_keystone_url
# - overcloud_admin_password
Role Variables: main.yml¶
# While options found within the vars/ path can be overridden using extra
# vars, items within this path are considered part of the role and not
# intended to be modified.
metadata:
name: Verify overcloud services state after running a deployment or an update
description: >
An Ansible role to verify the Overcloud services states after a deployment
or an update. It checks the API /os-services and looks for deprecated
services (nova-consoleauth) or any down services.
groups:
- post-deployment
- post-upgrade
- post-overcloud-upgrade
- post-overcloud-converge
Molecule Scenarios¶
Molecule is being used to test the “overcloud_service_status” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.
- Driver: podman
- Driver: podman
- Driver: podman
Scenario: deprecated_services¶
Molecule Platform(s)¶
- name: centos
hostname: centos
image: centos/centos:stream8
registry:
url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*-setuptools python*-pyyaml
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
privileged: true
environment:
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
ulimits:
- host
Molecule Inventory¶
hosts:
all:
hosts:
centos:
ansible_python_interpreter: /usr/bin/python3
overcloud_keystone_url: http://127.0.0.1:8080
overcloud_admin_password: hello
Example deprecated_services playbook¶
- name: Converge
hosts: all
tasks:
- block:
- name: Include overcloud_service_status role
include_role:
name: overcloud_service_status
rescue:
- fail:
msg: Default test failed
when: molecule_yml.scenario.name == "default"
- set_fact:
output_var: "{{ lookup('vars', molecule_yml.scenario.name + '_output')}}"
- fail:
msg: No {{ molecule_yml.scenario.name }} found
when: "'failed' not in output_var"
Scenario: down_services¶
Molecule Platform(s)¶
- name: centos
hostname: centos
image: centos/centos:stream8
registry:
url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*-setuptools python*-pyyaml
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
privileged: true
environment:
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
ulimits:
- host
Molecule Inventory¶
hosts:
all:
hosts:
centos:
ansible_python_interpreter: /usr/bin/python3
overcloud_keystone_url: http://127.0.0.1:8080
overcloud_admin_password: hello
Example down_services playbook¶
- name: Converge
hosts: all
tasks:
- block:
- name: Include overcloud_service_status role
include_role:
name: overcloud_service_status
rescue:
- fail:
msg: Default test failed
when: molecule_yml.scenario.name == "default"
- set_fact:
output_var: "{{ lookup('vars', molecule_yml.scenario.name + '_output')}}"
- fail:
msg: No {{ molecule_yml.scenario.name }} found
when: "'failed' not in output_var"
Scenario: default¶
Molecule Platform(s)¶
- name: centos
hostname: centos
image: centos/centos:stream8
registry:
url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*-setuptools python*-pyyaml
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
privileged: true
environment:
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
ulimits:
- host
Molecule Inventory¶
hosts:
all:
hosts:
centos:
ansible_python_interpreter: /usr/bin/python3
overcloud_keystone_url: http://127.0.0.1:8080
overcloud_admin_password: hello
Example default playbook¶
- name: Converge
hosts: all
tasks:
- block:
- name: Include overcloud_service_status role
include_role:
name: overcloud_service_status
rescue:
- fail:
msg: Default test failed
when: molecule_yml.scenario.name == "default"
- set_fact:
output_var: "{{ lookup('vars', molecule_yml.scenario.name + '_output')}}"
- fail:
msg: No {{ molecule_yml.scenario.name }} found
when: "'failed' not in output_var"