69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
---
|
|
- hosts: undercloud
|
|
vars:
|
|
metadata:
|
|
name: Undercloud Neutron Sanity Check
|
|
description: >
|
|
Run `neutron-sanity-check` on the undercloud node to find out
|
|
potential issues with Neutron's configuration.
|
|
|
|
The tool expects all the configuration files that are passed
|
|
to the Neutron services.
|
|
|
|
groups:
|
|
- pre-introspection
|
|
|
|
# The list of Neutron configuration files and directories that
|
|
# will be passed to the Neutron services. The order is important
|
|
# here: the values in later files take precedence.
|
|
configs:
|
|
- /etc/neutron/neutron.conf
|
|
- /usr/share/neutron/neutron-dist.conf
|
|
- /etc/neutron/metadata_agent.ini
|
|
- /etc/neutron/dhcp_agent.ini
|
|
- /etc/neutron/plugins/ml2/openvswitch_agent.ini
|
|
- /etc/neutron/fwaas_driver.ini
|
|
- /etc/neutron/l3_agent.ini
|
|
- /usr/share/neutron/neutron-lbaas-dist.conf
|
|
- /etc/neutron/lbaas_agent.ini
|
|
|
|
tasks:
|
|
- include_tasks: tasks/deprecation.yaml
|
|
|
|
- name: Run neutron-sanity-check
|
|
command: "docker exec -u root neutron_ovs_agent /bin/bash -c 'neutron-sanity-check --config-file {{ item }}'"
|
|
with_items: "{{ configs }}"
|
|
become: true
|
|
register: nsc_return
|
|
ignore_errors: true
|
|
changed_when: False
|
|
|
|
- name: Detect errors
|
|
set_fact:
|
|
has_errors: "{{ nsc_return.results
|
|
| sum(attribute='stderr_lines', start=[])
|
|
| select('search', '(ERROR)')
|
|
| list | length | int > 0 }}"
|
|
|
|
- name: Detect warnings
|
|
set_fact:
|
|
has_warnings: "{{ nsc_return.results
|
|
| sum(attribute='stderr_lines', start=[])
|
|
| select('search', '(WARNING)')
|
|
| list | length | int > 0 }}"
|
|
|
|
- name: Create output
|
|
set_fact:
|
|
output_msg: "{{ nsc_return.results
|
|
| sum(attribute='stderr_lines', start=[])
|
|
| select('search', '(ERROR|WARNING)')
|
|
| list }}"
|
|
|
|
- name: Output warning
|
|
warn: msg="{{ output_msg | join('\n') }}"
|
|
when: has_warnings and not has_errors
|
|
|
|
- name: Fail
|
|
fail: msg="{{ output_msg | join('\n') }}"
|
|
when: has_errors
|