I’m using Ansible Galaxy v2.9.15 and attempting to install roles. This is all run as part of a Jenkins pipeline so ansible-galaxy is used across several jobs all installing the same central roles when they’re run.
extracting ansible.digital.roles to /home/jenkins-slave/.ansible/roles/ansible.digital.roles
[WARNING]: - ansible.digital.roles was NOT installed successfully: /home /jenkins-slave/.ansible/roles/ansible.digital.roles doesn’t appear to contain a role. please remove this directory manually if you really want to put the role here. ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.
So, this error occurs and if I then re-run this after deleting the ansible.digital.roles directory manually, it works fine. However, re-running again after it succeeds ends up with the above error again.
Does anyone know a solution/work around? Is using --ignore-errors a safe way to workaround this or could it end up masking other errors down the line?
I'm using Ansible Galaxy v2.9.15 and attempting to install roles. This is all run as part of a Jenkins pipeline so
ansible-galaxy is used across several jobs all installing the same central roles when they're run.
[WARNING]: - ansible.digital.roles was NOT installed successfully: /home
/jenkins-slave/.ansible/roles/ansible.digital.roles doesn't appear to contain a role. please remove this directory
manually if you really want to put the role here. ERROR! - you can use --ignore-errors to skip failed roles and finish
processing the list.
So, this error occurs and if I then re-run this after deleting the ansible.digital.roles directory manually, it works
fine. However, re-running again after it succeeds ends up with the above error again.
Does anyone know a solution/work around? Is using --ignore-errors a safe way to workaround this or could it end up
masking other errors down the line?
Thanks,
Riain
Hello Riain,
why don't you remove the target directory before running the ansible-galaxy install?
With using --force it downloads and overwrites the files in the target directory anyway.
Thanks for the quick reply! That’s a great and simple idea, thanks! I suppose as we are overwriting it anyway it probably would have the same effect on other jobs running.
That being said, is there a way to set the role installation directory on the fly? It might make more sense to install it to the job’s directory and clean that each time, rather than a central directory, if that makes sense.
Thanks for the quick reply! That's a great and simple idea, thanks! I suppose as we are overwriting it anyway it
probably would have the same effect on other jobs running.
That being said, is there a way to set the role installation directory on the fly? It might make more sense to install
it to the job's directory and clean that each time, rather than a central directory, if that makes sense.
Thanks again,
Riain
Hello Riain,
yes it makes sense to install it in the job directory. You can tell Ansible where to look for roles, so that should be
no problem.
Also if you retrieve the role from a git repository, it probably behaves in the same way when you using git to install
the role.