overcloud_service_status

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.

overcloud_deprecated_services:
  nova:
  - nova-consoleauth
overcloud_service_api:
- nova
- cinderv3
overcloud_service_status_debug: false

Role Variables: main.yml

metadata:
  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
  name: Verify overcloud services state after running a deployment or an update

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.

Scenario: deprecated_services

Example deprecated_services configuration
provisioner:
  env:
    ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
    ANSIBLE_ROLES_PATH: ${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles
    ANSIBLE_STDOUT_CALLBACK: yaml
  inventory:
    hosts:
      all:
        hosts:
          centos:
            ansible_python_interpreter: /usr/bin/python3
            overcloud_admin_password: hello
            overcloud_keystone_url: http://127.0.0.1:8080
  log: true
  name: ansible
  playbooks:
    converge: ../../resources/playbooks/converge.yml
    prepare: ../../resources/playbooks/prepare.yml
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
        overcloud_admin_password: hello
        overcloud_keystone_url: http://127.0.0.1:8080
Example deprecated_services playbook
- hosts: all
  name: Converge
  tasks:
  - block:
    - include_role:
        name: overcloud_service_status
      name: Include overcloud_service_status role
    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

Example default configuration
provisioner:
  env:
    ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
    ANSIBLE_ROLES_PATH: ${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles
    ANSIBLE_STDOUT_CALLBACK: yaml
  inventory:
    hosts:
      all:
        hosts:
          centos:
            ansible_python_interpreter: /usr/bin/python3
            overcloud_admin_password: hello
            overcloud_keystone_url: http://127.0.0.1:8080
  log: true
  name: ansible
  playbooks:
    converge: ../../resources/playbooks/converge.yml
    prepare: ../../resources/playbooks/prepare.yml
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
        overcloud_admin_password: hello
        overcloud_keystone_url: http://127.0.0.1:8080
Example default playbook
- hosts: all
  name: Converge
  tasks:
  - block:
    - include_role:
        name: overcloud_service_status
      name: Include overcloud_service_status role
    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

Example down_services configuration
provisioner:
  env:
    ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
    ANSIBLE_ROLES_PATH: ${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles
    ANSIBLE_STDOUT_CALLBACK: yaml
  inventory:
    hosts:
      all:
        hosts:
          centos:
            ansible_python_interpreter: /usr/bin/python3
            overcloud_admin_password: hello
            overcloud_keystone_url: http://127.0.0.1:8080
  log: true
  name: ansible
  playbooks:
    converge: ../../resources/playbooks/converge.yml
    prepare: ../../resources/playbooks/prepare.yml
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
        overcloud_admin_password: hello
        overcloud_keystone_url: http://127.0.0.1:8080
Example down_services playbook
- hosts: all
  name: Converge
  tasks:
  - block:
    - include_role:
        name: overcloud_service_status
      name: Include overcloud_service_status role
    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'