diff --git a/IM/CtxtAgentBase.py b/IM/CtxtAgentBase.py index 15457ccb..486789b1 100644 --- a/IM/CtxtAgentBase.py +++ b/IM/CtxtAgentBase.py @@ -508,7 +508,7 @@ def install_ansible_roles(self, general_conf_data, playbook): task["name"] = "Create YAML file to install the collections with ansible-galaxy" yaml_data[0]['tasks'].append(task) - task = {"command": "ansible-galaxy collection install -c -r %s" % filename} + task = {"command": "/var/tmp/.ansible/bin/ansible-galaxy collection install -c -r %s" % filename} task["name"] = "Install galaxy collections" task["become"] = "yes" task["register"] = "collections_install" @@ -562,7 +562,7 @@ def install_ansible_roles(self, general_conf_data, playbook): task["name"] = "Create YAML file to install the roles with ansible-galaxy" yaml_data[0]['tasks'].append(task) - task = {"command": "ansible-galaxy install -c -r %s" % filename} + task = {"command": "/var/tmp/.ansible/bin/ansible-galaxy install -c -r %s" % filename} task["name"] = "Install galaxy roles" task["become"] = "yes" task["register"] = "roles_install" diff --git a/test/unit/test_ctxt_agent.py b/test/unit/test_ctxt_agent.py index bc4894b2..7354646f 100755 --- a/test/unit/test_ctxt_agent.py +++ b/test/unit/test_ctxt_agent.py @@ -277,7 +277,8 @@ def test_95_install_ansible_roles(self): copy_content = yaml_data[0]['tasks'][1]['copy'][pos + 9:-2] self.assertEqual(copy_content, "[{src: ansible_role}, {name: hadoop, src: " "'git+https://github.com/micafer/ansible-role-hadoop'}]") - self.assertEqual(yaml_data[0]['tasks'][2]['command'][:47], "ansible-galaxy install -c -r /tmp/galaxy_roles_") + self.assertEqual(yaml_data[0]['tasks'][2]['command'][:69], + "/var/tmp/.ansible/bin/ansible-galaxy install -c -r /tmp/galaxy_roles_") os.unlink(res) @@ -300,8 +301,8 @@ def test_99_install_ansible_collections(self): pos = yaml_data[0]['tasks'][0]['copy'].find('content="') copy_content = yaml_data[0]['tasks'][0]['copy'][pos + 9:-2] self.assertEqual(copy_content, "{collections: [{name: ns.collection, version: '1.0'}]}") - self.assertEqual(yaml_data[0]['tasks'][1]['command'][:64], - "ansible-galaxy collection install -c -r /tmp/galaxy_collections_") + self.assertEqual(yaml_data[0]['tasks'][1]['command'][:86], + "/var/tmp/.ansible/bin/ansible-galaxy collection install -c -r /tmp/galaxy_collections_") os.unlink(res)