diff --git a/hot/software-config/elements/heat-config-ansible/install.d/hook-ansible.py b/hot/software-config/elements/heat-config-ansible/install.d/hook-ansible.py index 0cf83e4..c48c332 100755 --- a/hot/software-config/elements/heat-config-ansible/install.d/hook-ansible.py +++ b/hot/software-config/elements/heat-config-ansible/install.d/hook-ansible.py @@ -78,8 +78,8 @@ def main(argv=sys.argv): '@%s' % vars_filename ] if tags: - cmd.insert(-1, '--tags') - cmd.insert(-1, tags) + cmd.insert(3, '--tags') + cmd.insert(4, tags) log.debug('Running %s' % (' '.join(cmd),)) try: subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE, diff --git a/tests/software_config/test_hook_ansible.py b/tests/software_config/test_hook_ansible.py index 0f2830c..8f0b789 100644 --- a/tests/software_config/test_hook_ansible.py +++ b/tests/software_config/test_hook_ansible.py @@ -103,11 +103,12 @@ class HookAnsibleTest(common.RunScriptTest): expected_args = [ self.fake_tool_path, '-i', - 'localhost,', - ansible_playbook, - '--extra-vars'] + 'localhost,'] if options: expected_args += options + expected_args += [ + ansible_playbook, + '--extra-vars'] expected_args.append('@%s' % vars_filename) self.assertEqual(expected_args, state['args'])