Score:0

Search and list AWX-Inventory in a playbook

in flag

I need help with Ansible AWX Inventory. We have many/different inventories on our AWX server which we are importing through different methods.

I have a requirement to search and fetch inventory names in a playbook and put it in a list, which starts from (ABC_DateTime) or (XYZ_DateTime) and create schedule on AWX through playbook. Inventory file is dynamic and changing every time but Prefix is fixed (ABC_, XYZ_).

Can you guys please help me to write a playbook that I would run on AWX server locally and it could fetch inventories starts from (ABC_* or XYZ_ *)

In a play book, I need to get inventory in two different lists (for XYZ) and (for ABC) so I could use it for scheduling. All I care about to fetch dynamic inventory name in playbook and store it in a variable/list. i.e.

...
ABC_2022-04-20
ABC_2022-06-29
ABC_2022-03-20
XYZ_2022-03-20
XYZ_2022-02-19
XYZ_2022-03-23
...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.