Set the config ID as an ansible variable

This change sets the ansible variable called heat_config_id to the
'id' value of the heat config data.

This will be useful in some playbooks to make idempotency decisions.

Change-Id: I5f03e012b2fb97cc0076c886ca7bd3f284d19032
This commit is contained in:
Steve Baker 2017-04-28 13:33:27 +12:00
parent 1a44aa71d1
commit 3a86f8789c
2 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,7 @@ def main(argv=sys.argv):
c = json.load(sys.stdin)
variables = {}
variables['heat_config_id'] = c['id']
for input in c['inputs']:
variables[input['name']] = input.get('value', '')

View File

@ -187,6 +187,7 @@ class HookAnsibleTest(common.RunScriptTest):
variables = self.json_from_file(vars_filename)
self.assertEqual('bar', variables['foo'])
self.assertEqual('input', variables['another'])
self.assertEqual('1234', variables['heat_config_id'])
self.assertEqual(self.outputs_dir.join('1234'),
variables['heat_outputs_path'])