cddac5f1e9
So currently if some optional openstack service is not installed metadata will fail when it tires to work on its config file. This commit adds in a check for the existance of each service config before running the gathering tasks. What might be a useful addition to this commit would be some logic for determining which services should never be missing and alerting the user. Change-Id: Ie360f062646cb5431de9ed21bd0dd193b84ddcda
33 lines
837 B
YAML
33 lines
837 B
YAML
---
|
|
#
|
|
# Tasks to get neutron facts
|
|
#
|
|
|
|
- name: Check that Neutron is installed
|
|
become: true
|
|
stat: path=/etc/neutron/neutron.conf
|
|
register: neutron_config
|
|
|
|
- name: Parse Neutron config
|
|
become: true
|
|
shell: python /tmp/openstack-config-parser.py neutron /etc/neutron/neutron.conf /tmp/out.yml
|
|
when: neutron_config.stat.exists
|
|
|
|
- name: Fetch output
|
|
fetch: src=/tmp/out.yml dest=/tmp/out.yml flat=yes
|
|
when: neutron_config.stat.exists
|
|
|
|
- name: Load configuration variables
|
|
include_vars: /tmp/out.yml
|
|
when: neutron_config.stat.exists
|
|
|
|
- name: Parse Neutron plugin.ini
|
|
become: true
|
|
shell: python /tmp/openstack-config-parser.py neutron-plugin /etc/neutron/plugin.ini /tmp/out.yml
|
|
|
|
- name: Fetch output
|
|
fetch: src=/tmp/out.yml dest=/tmp/out.yml flat=yes
|
|
|
|
- name: Load configuration variables
|
|
include_vars: /tmp/out.yml
|