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