System Requirement for awx - AWX Project - Ansible
AWX collections/requirements.yml
AWX Not Reading requirements.yml
What are the Hardware requirements for deploying awx in kubernetes ?
I'm having issues trying to run a playbook that's stored on our GitHub in my requirements.yml file via AWX. As I run the template, the playbook passes but seems to not even attempt to read the requirements file at all. The collections seem to work when I run it my playbook.yml file, but the goal is to be run some remote playbooks separately as a requirement.
From what I have seen online, requirements.yml is supposed to be placed within the roles directory for AWX to automatically read and run the file. Is there an issue with the structure of the playbook directories? Is possible we are missing a setting in AWX to it see requirements.yml?
@SwiperNo, I feel your pain. Reading your question, I can see that you have the right aspects for using galaxy with AWX. In my experience, and long hours of testing / troubleshooting, the following worked for me:
- A gitlab or github project with a "collections" folder and a "requirements.yml" within it.
- Contents of the requirements.yml might be:
---
collections:
- name: chocolatey.chocolatey
source: https://galaxy.ansible.com
Setup AWX with a "Source Control" credential using a token (Token generated from Gitlab/Github)
Setup an AWX Project with the "Source Control Type" as "Git" and use the "Source Control Credential" created in step 3. I also ticked the option "Update Revision on Launch" to update the Git source in the cache a runtime.
Ensure you have a PersistentVolume attached to the AWX instance. The Git source and collections need to cache it locally from what I understand and believe this could be part of your problem. See the following link re PersistentVolume, you can add the config to the awx.yml file, which you would have used to build the K3s instance at the begining. https://docs.ansible.com/automation-controller/4.0.0/html_zh/administration/operator_advanced_configurations.html#persist-projects-directory
Lastly, I would recommend enabling verbose debugging within the template and see if there are errors which pertain to caching or the requirements.yml.
For reference, AWX build using K3s. https://github.com/ansible/awx-operator#persisting-projects-directory
Install the ansible-galaxy command if it is not already installed.
You can install it using the following command:
pip3 install ansible-galaxy
Navigate to your project directory and run the ansible-galaxy command to download the collections specified in the collections/requirements.yml file.
For example, if your requirements.yml file contains the VMware collection, you can run the following command:
ansible-galaxy collection install -r collections/requirements.yml
/!\ I'm not an expert with AWX with k3s but it may be help you
Ref to this: ansible docs AWX will detect it and run the needed ansible-galaxy command for you. Make sure that collection download has not been disabled in your awx/tower settings on the AWX console.