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
24 lines
511 B
YAML
24 lines
511 B
YAML
---
|
|
#
|
|
# Tasks to get nova facts
|
|
#
|
|
|
|
- name: Check that Nova is installed
|
|
become: true
|
|
stat: path=/etc/nova/nova.conf
|
|
register: nova_config
|
|
|
|
- name: Parse Nova config
|
|
become: true
|
|
shell: python /tmp/openstack-config-parser.py nova /etc/nova/nova.conf /tmp/out.yml
|
|
when: nova_config.stat.exists
|
|
|
|
- name: Fetch output
|
|
fetch: src=/tmp/out.yml dest=/tmp/out.yml flat=yes
|
|
when: nova_config.stat.exists
|
|
|
|
- name: Load configuration variables
|
|
include_vars: /tmp/out.yml
|
|
when: nova_config.stat.exists
|
|
|