I had a instance where I wanted to test Manual SCM (Source Control Credential Type) project on new Project on Ansible AWX tower instead of git repository. While creating a new project when choosing Manual from the Source Control Credential Type (SCM), I was receiving below error.
Getting started Ansible AWX tower for IT automation run first playbook
WARNING: There are no available playbook directories in /var/lib/awx/projects. Either that directory is empty, or all of the contents are already assigned to other projects. Create a new directory there and make sure the playbook files can be read by the "awx" system user, or have AWX directly retrieve your playbooks from source control using the Source Control Type option above.
As this was freshly deployed Ansible AWX server, to use manual there need to be projects and yml playbooks with directory created with below command steps. My Ansible AWX server is installed as containers on Docker.
docker ps docker exec -it awx_web bash pwd cd /var/lib/awx ls mkdir projects cd projects mkdir ping-system cd ping-system pwd cat > ping-playbook.yml
I am using below sample ansible yml playbook and below contents are saved under ping-playbook.yml file.
1 2 3 4 5 6 |
--- - name: Check connectivity to remote servers hosts: all #servergroup01 tasks: - name: ping ping: |
Playbook yml file looks like below.
Once the new file is created refresh Ansible AWX url in browser, Create a new Project again, note warning message is gone now, By default Project Base Path is /var/lib/awx/projects, from Playbook Directory choose the folder created earlier from the list.
Once the project is created, Now on the creating New Job Template wizard yml playbook list is visible.
Useful Articles
How to install Docker on Linux
How to install Ansible on Linux for vSphere configuration
Getting started Ansible AWX tower for IT automation run first playbook
Ansible for VMwary Using vmware_vm_inventory dynamic inventory plugin
Ansible selectattr The error was TemplateRuntimeError no test named 'equalto'
ansible create an array with set_fact
Ansible get information from esxi advanced settings nested dictionary with unique keynames