Moving setting validation from nova_event_callback
The newly introduced role oslo_config_validator is probably a better framework to validate settings as it's centralized and will most probably be called by sosreport for troubleshooting purpose. It only makes sense to move some setting validations to this new role when possible. This patch also adds the nova_event_callback role documentation in sphinx. Closes-Bug: #1934609 Conflicts: - playbooks/nova-event-callback.yaml Change-Id: Iac8126429773d3b63d17ad851d24e8c6f498f557 (cherry picked from commit23992a3576
) (cherry picked from commit23a2ec2164
) (cherry picked from commit0c00c50064
)
This commit is contained in:
parent
fde948a0d8
commit
1a2243b891
|
@ -2,6 +2,48 @@
|
||||||
nova_event_callback
|
nova_event_callback
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
--------------
|
||||||
|
About the role
|
||||||
|
--------------
|
||||||
|
|
||||||
|
An Ansible role to check if the **Nova** ``auth_url`` in **Neutron** is
|
||||||
|
configured correctly on the **Overcloud Controller(s)**.
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
============
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
============
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
Example Playbook
|
||||||
|
================
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
- hosts: Controller
|
||||||
|
vars:
|
||||||
|
neutron_config_file: /path/to/neutron.conf
|
||||||
|
roles:
|
||||||
|
- nova_event_callback
|
||||||
|
|
||||||
|
License
|
||||||
|
=======
|
||||||
|
|
||||||
|
Apache
|
||||||
|
|
||||||
|
Author Information
|
||||||
|
==================
|
||||||
|
|
||||||
|
**Red Hat TripleO DFG:Compute Deployment Squad**
|
||||||
|
|
||||||
|
----------------
|
||||||
|
Full Description
|
||||||
|
----------------
|
||||||
|
|
||||||
.. ansibleautoplugin::
|
.. ansibleautoplugin::
|
||||||
:role: roles/nova_event_callback
|
:role: roles/nova_event_callback
|
||||||
|
|
||||||
|
|
|
@ -4,26 +4,13 @@
|
||||||
metadata:
|
metadata:
|
||||||
name: Nova Event Callback Configuration Check
|
name: Nova Event Callback Configuration Check
|
||||||
description: >
|
description: >
|
||||||
This validations verifies that the Nova Event Callback feature is
|
This validations verifies that the Nova auth_url in neutron,
|
||||||
configured which is generally enabled by default.
|
which is generally enabled by default, is configured correctly
|
||||||
|
|
||||||
It checks the following files on the Overcloud Controller(s):
|
It checks the following files on the Overcloud Controller(s):
|
||||||
- /etc/nova/nova.conf:
|
- **/etc/neutron/neutron.conf**: [nova]/auth_url = 'http://nova_admin_auth_ip:5000'
|
||||||
[DEFAULT]/vif_plugging_is_fatal = True
|
|
||||||
[DEFAULT]/vif_plugging_timeout >= 300
|
|
||||||
- /etc/neutron/neutron.conf:
|
|
||||||
[nova]/auth_url = 'http://nova_admin_auth_ip:5000'
|
|
||||||
[nova]/tenant_name = 'service'
|
|
||||||
[DEFAULT]/notify_nova_on_port_data_changes = True
|
|
||||||
[DEFAULT]/notify_nova_on_port_status_changes = True
|
|
||||||
groups:
|
groups:
|
||||||
- post-deployment
|
- post-deployment
|
||||||
nova_config_file: /var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf
|
|
||||||
neutron_config_file: /var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf
|
neutron_config_file: /var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf
|
||||||
vif_plugging_fatal_check: "vif_plugging_is_fatal"
|
|
||||||
vif_plugging_timeout_check: "vif_plugging_timeout"
|
|
||||||
vif_plugging_timeout_value_min: 300
|
|
||||||
notify_nova_on_port_data_check: "notify_nova_on_port_data_changes"
|
|
||||||
notify_nova_on_port_status_check: "notify_nova_on_port_status_changes"
|
|
||||||
tenant_name_check: "tenant_name"
|
|
||||||
roles:
|
roles:
|
||||||
- nova_event_callback
|
- nova_event_callback
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
---
|
---
|
||||||
nova_config_file: /var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf
|
# Absolute path of the neutron configuration file
|
||||||
neutron_config_file: /var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf
|
neutron_config_file: /var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf
|
||||||
vif_plugging_fatal_check: "vif_plugging_is_fatal"
|
|
||||||
vif_plugging_timeout_check: "vif_plugging_timeout"
|
|
||||||
vif_plugging_timeout_value_min: 300
|
|
||||||
notify_nova_on_port_data_check: "notify_nova_on_port_data_changes"
|
|
||||||
notify_nova_on_port_status_check: "notify_nova_on_port_status_changes"
|
|
||||||
tenant_name_check: "tenant_name"
|
|
||||||
|
|
|
@ -1,35 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Get vif_plugging_fatal value from nova.conf
|
|
||||||
become: true
|
|
||||||
validations_read_ini:
|
|
||||||
path: "{{ nova_config_file }}"
|
|
||||||
section: DEFAULT
|
|
||||||
key: "{{ vif_plugging_fatal_check }}"
|
|
||||||
ignore_missing_file: true
|
|
||||||
register: vif_plugging_fatal_value
|
|
||||||
|
|
||||||
- name: Get vif_plugging_timeout value from nova.conf
|
|
||||||
become: true
|
|
||||||
validations_read_ini:
|
|
||||||
path: "{{ nova_config_file }}"
|
|
||||||
section: DEFAULT
|
|
||||||
key: "{{ vif_plugging_timeout_check }}"
|
|
||||||
ignore_missing_file: true
|
|
||||||
register: vif_plugging_timeout_value
|
|
||||||
|
|
||||||
- name: Ensure vif plugging timeout minimum
|
|
||||||
fail:
|
|
||||||
msg: "vif_plugging_timeout is below minimum value. Minimum: {{ vif_plugging_timeout_value_min|int }}. Current value: {{ vig_plugging_timeout_value }}"
|
|
||||||
when: "{{ vif_plugging_timeout_value|int < vif_plugging_timeout_value_min|int }}"
|
|
||||||
|
|
||||||
- name: Ensure vif plugging is fatal
|
|
||||||
fail:
|
|
||||||
msg: "vif_plugging_fatal should be set to True. Current value: {{ vif_plugging_fatal_value }}."
|
|
||||||
when: "not {{ vif_plugging_fatal_value|bool }}"
|
|
||||||
|
|
||||||
- name: Get auth_url value from hiera
|
- name: Get auth_url value from hiera
|
||||||
become: true
|
become: true
|
||||||
command: hiera -c /etc/puppet/hiera.yaml neutron::server::notifications::auth_url
|
command: hiera -c /etc/puppet/hiera.yaml neutron::server::notifications::nova::auth_url
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: auth_url
|
register: auth_url
|
||||||
|
@ -50,38 +22,3 @@
|
||||||
{{ neutron_auth_url_result.value or 'None' }}
|
{{ neutron_auth_url_result.value or 'None' }}
|
||||||
but it should be set to {{ auth_url.stdout }}.
|
but it should be set to {{ auth_url.stdout }}.
|
||||||
failed_when: "neutron_auth_url_result.value != auth_url.stdout"
|
failed_when: "neutron_auth_url_result.value != auth_url.stdout"
|
||||||
|
|
||||||
- name: Get Notify Nova settings values from neutron.conf
|
|
||||||
become: true
|
|
||||||
validations_read_ini:
|
|
||||||
path: "{{ neutron_config_file }}"
|
|
||||||
section: DEFAULT
|
|
||||||
key: "{{ item }}"
|
|
||||||
ignore_missing_file: true
|
|
||||||
register: neutron_notify_nova_result
|
|
||||||
with_items:
|
|
||||||
- "{{ notify_nova_on_port_data_check }}"
|
|
||||||
- "{{ notify_nova_on_port_status_check }}"
|
|
||||||
|
|
||||||
- name: Check Notify Nova settings values
|
|
||||||
fail:
|
|
||||||
msg: "Value of {{ item.item }} is set to {{ item.value|bool }}."
|
|
||||||
when: not item.value|bool or item.value == None
|
|
||||||
with_items: "{{ neutron_notify_nova_result.results }}"
|
|
||||||
|
|
||||||
- name: Get Tenant Name setting value from neutron.conf
|
|
||||||
become: true
|
|
||||||
validations_read_ini:
|
|
||||||
path: "{{ neutron_config_file }}"
|
|
||||||
section: nova
|
|
||||||
key: "{{ tenant_name_check }}"
|
|
||||||
ignore_missing_file: true
|
|
||||||
register: neutron_tenant_name_result
|
|
||||||
|
|
||||||
- name: Check Tenant Name settings value
|
|
||||||
fail:
|
|
||||||
msg: >-
|
|
||||||
[nova]/tenant_name from {{ neutron_config_file }} is set to
|
|
||||||
{{ neutron_tenant_name_result.value or 'None' }}
|
|
||||||
but it should be set to 'service'.
|
|
||||||
when: neutron_tenant_name_result.value != 'service'
|
|
||||||
|
|
|
@ -2,16 +2,10 @@
|
||||||
metadata:
|
metadata:
|
||||||
name: Nova Event Callback Configuration Check
|
name: Nova Event Callback Configuration Check
|
||||||
description: >
|
description: >
|
||||||
This validations verifies that the Nova Event Callback feature is
|
This validations verifies that the Nova auth_url in neutron,
|
||||||
configured which is generally enabled by default.
|
which is generally enabled by default, is configured correctly
|
||||||
It checks the following files on the Overcloud Controller(s):
|
It checks the following files on the Overcloud Controller(s):
|
||||||
- /etc/nova/nova.conf:
|
- /etc/neutron/neutron.conf:
|
||||||
[DEFAULT]/vif_plugging_is_fatal = True
|
[nova]/auth_url = 'http://nova_admin_auth_ip:5000'
|
||||||
[DEFAULT]/vif_plugging_timeout >= 300
|
|
||||||
- /etc/neutron/neutron.conf:
|
|
||||||
[nova]/auth_url = 'http://nova_admin_auth_ip:5000'
|
|
||||||
[nova]/tenant_name = 'service'
|
|
||||||
[DEFAULT]/notify_nova_on_port_data_changes = True
|
|
||||||
[DEFAULT]/notify_nova_on_port_status_changes = True
|
|
||||||
groups:
|
groups:
|
||||||
- post-deployment
|
- post-deployment
|
||||||
|
|
Loading…
Reference in New Issue