Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions IM/ConfManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,8 @@ def configure_ansible(self, ssh, tmp_dir, ansible_version=None):

recipe_out.write("\n - name: Delete the %s collection\n" % galaxy_name)
galaxy_name = galaxy_name.replace(".", "/")
recipe_out.write(" file: state=absent path=/etc/ansible/ansible_collections/%s\n" %
galaxy_name)
recipe_out.write(" file: state=absent path=%s/ansible_collections/%s\n" %
(CtxtAgentBase.ANSIBLE_DIR, galaxy_name))

recipe_out.close()

Expand All @@ -1476,7 +1476,8 @@ def configure_ansible(self, ssh, tmp_dir, ansible_version=None):
recipe_out = open(tmp_dir + "/" + ConfManager.MASTER_YAML, 'a')

recipe_out.write("\n - name: Delete the %s role\n" % galaxy_name)
recipe_out.write(" file: state=absent path=/etc/ansible/roles/%s\n" % galaxy_name)
recipe_out.write(" file: state=absent path=%s/roles/%s\n" %
(CtxtAgentBase.ANSIBLE_DIR, galaxy_name))

recipe_out.close()

Expand Down
1 change: 1 addition & 0 deletions IM/CtxtAgentBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CtxtAgentBase:
MAMBA_BIN = "/var/tmp/.mamba/bin/micromamba" # nosec
MAMBA_ENV_DIR = MAMBA_DIR + "/envs/" + MAMBA_ENV_NAME # nosec
MAMBA_CMD = MAMBA_BIN + " run -n " + MAMBA_ENV_NAME + " " # nosec
ANSIBLE_DIR = "/var/tmp/ansible" # nosec
ANSIBLE_CFG_FILE = "/var/tmp/ansible.cfg" # nosec

def __init__(self, conf_data_filename):
Expand Down
11 changes: 6 additions & 5 deletions contextualization/ctxt_agent_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,14 @@ def contextualize_vm(self, general_conf_data, vm_conf_data, ctxt_vm, local):
ssh_client.sftp_put_dir(cache_dir, cache_dir)

self.logger.info("Copy ansible roles to: %s" % ctxt_vm['ip'])
ssh_client.sftp_mkdir("/etc/ansible/roles")
ssh_client.sftp_put_dir("/etc/ansible/roles", "/etc/ansible/roles")
ssh_client.sftp_mkdir(self.ANSIBLE_DIR + "/roles")
ssh_client.sftp_put_dir(self.ANSIBLE_DIR + "/roles",
self.ANSIBLE_DIR + "/roles")

self.logger.info("Copy ansible collections to: %s" % ctxt_vm['ip'])
ssh_client.sftp_mkdir("/etc/ansible/ansible_collections")
ssh_client.sftp_put_dir("/etc/ansible/ansible_collections",
"/etc/ansible/ansible_collections")
ssh_client.sftp_mkdir(self.ANSIBLE_DIR + "/ansible_collections")
ssh_client.sftp_put_dir(self.ANSIBLE_DIR + "/ansible_collections",
self.ANSIBLE_DIR + "/ansible_collections")
except Exception:
self.logger.exception("Error copying cache to VM: " + ctxt_vm['ip'])
else:
Expand Down
Loading