AAP playbook issue - Could not match supplied host patter, ignoring: xxx

Hello,

I have a playbook, I run it on my server with command (sth like ansible-playbook myplaybook.yml -i myinventory.yml -e @myvariables.yml) first , it worked well.

My goal is to run it on AAP (ansible automation platform) console, so I configured a job template, set variables and inventory file for it, but when I run it, it gave me a warning like below “Could not match supplied host patter, ignoring: xxx”, the playbook just stopped, however, if I run it with command on my ansible server, playbook could run and gave me the expected result

At this point, I think I did NOT configure the inventory correctly for my playbook, I copied the content from myinventory.yml and pasted it in the variables of the inventory record in AAP console, please see the picture above

I tried to search for some instructions about how to configure inventory in AAP console, but there is limited information about it, it’s appreciated if anyone can provide some information about how to configure inventory on AAP console.

@3y3l Hello!

The Variables textarea in Inventory screen is textarea for inventory variables NOT inventory host data.

The following “19.4. Add a new inventory” will help you set up the inventory host data.

https://docs.ansible.com/automation-controller/latest/html/userguide/inventories.html#add-a-new-inventory

1 Like

If you store your inventory file in your SCM repo you can import it into AAP. Otherwise you’ll need to add your hosts to the inventory that matches your inventory on the server.

https://access.redhat.com/documentation/en-us/red_hat_ansible_automation_platform/2.4/html/automation_controller_administration_guide/assembly-inventory-file-importing

Hello, thanks for your reply, I checked the doc and have fixed this issue successfully.

1 Like

Hello, thanks for your reply, I have checked the official documents and fixed this issue.

1 Like