Can only run playbooks on localhost with AWX

Hello everyone,

I’m currently working on AWX 9.0.1.0 with Ansible 2.8.5. Here’s some info about my workflow:

  • I write playbooks/roles on my own machine, using Role Directory Structure, created by ansible-galaxy init <roleName>

  • I push these roles to GitHub, which is already connected to our AWX server as a project and it gets synched by scheduled jobs.

  • When creating a new template, after choosing our synched GitHub project, on the PLAYBOOK dropdown, I see all roles’ like /tests/test.yml

  • I also choose the target machines correctly on the INVENTORY field. The one I choose is a smart inventory, derived from a dynamic inventory sourced by a vSphere environment.

  • The problem is: When I run this newly created template on AWX, it runs without errors but it runs on localhost only, not on the machines I’ve chosen on the INVENTORY field.

I see there is an inventory file on tests\ directory and it has the only entry as localhost.

I emptied this inventory file and even deleted it but it still runs only on localhost.

What am I missing?

Thanks in advance.

Hi,

Have you made sure that /tests/test.yml contains ‘hosts: all’? If you had some other value, say for testing, then it would instead try to use that value which would then just treat the hosts you told it to use within AWX as a filter. And thus any hosts in your AWX inventory that don’t match what you have actually defined in the playbook would be ignored.
PS- this forum is for Ansible only, not AWX. It has its own group(s).

Hi,

The file /tests/test.yml had ‘hosts: localhost’, hence it was filtering the value from AWX inventory field indeed. I replaced it as ‘hosts: all’ and it’s working now.

Sorry, I’ll post to AWX groups for AWX issues next time.

Thanks for your kind reply.

8 Nisan 2020 Çarşamba 18:00:25 UTC+3 tarihinde Michael M yazdı: