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:
parent
1a44aa71d1
commit
3a86f8789c
|
@ -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', '')
|
||||
|
||||
|
|
|
@ -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'])
|
||||
|
||||
|
|
Loading…
Reference in New Issue