Closed basictheprogram closed 4 years ago
@basictheprogram - Packer itself should be picking up the role requirements and installing them in the correct path so Ansible running in the VM can use them; see these lines https://github.com/geerlingguy/packer-boxes/blob/master/ubuntu2004/box-config.json#L16-L20
If that is not the case, then something seems incorrect in the Packer configuration, or the playbook you're using, maybe. It seems like you're using a playbook testing.yml
which I don't think comes from this repository.
The geerlingguy.java
role is not referenced in this project at all, so it seems that may be something you're adding to your testing.yml
playbook? If so, you need to make sure you're also adding the requirement for it to the requirements.yml
file in the shared
directory (assuming you are using the same kind of layout as this project uses). Otherwise, Packer's invocation of ansible-galaxy install -r ../shared/requirements.yml
will not install the geerlingguy.java
role inside the VM when it is building it.
testing.yml
---
- hosts: all
gather_facts: yes
tasks:
- ping:
I think the advise about the requirements.yml
will help. Let me play around with that. Thank you for your assistance.
You're welcome!
If you have the time can you explain to me how Ansible knows where to get your geerlingguy.* roles?
For example in shared/main.yml I see these roles
Looking in the
shared/requirements.yml
I do not see any hostname or url.In
ubuntu2004/box-config.json
I see the ansible-local variables playbook_file and galaxy_file so it hints that the role is coming from Galaxy.Does the version of Ansible downloaded from the ppa (scripts/ansible.sh) have defaults on where to look for your roles?
I am trying to build on your work for VMware Fusion and installing the official Ansible release from Ubuntu 20.04 (https://packages.ubuntu.com/focal/ansible) with apt (not with pip or from ppa) and the official package does not know how to retrieve your roles.
I am still a user of Ansible 2.9 and not familiar with Galaxy and Collections and
example/ansible.cfg
from the devel branch in GitHub does not have references to any of this information so I’m looking for assistance.Thank you.