Hi,
Just recently making the move from Ansible to Ansible AWX so excuse if this comes across as a daft question.
When trying to get some of my existing scripts to run from AWX i’m coming across a few issues which i’m sure is down to me missing something…
I have created the inventory manually and have a load of smart inventory groups to filter down the hosts to a subset of machines so we can run plays against a specific set.
Some of my scripts would check to see if the host is in a group before running the task. For example I have a script that stops certain services before shutting down a VM to make sure it is graceful.
- name: stop elasticsearch services
systemd:
name: elasticsearch
state: stopped
ignore_errors: true
when: “‘ElasticSearch-All’ in group_names”
So while this runs without error, it is not picking up that a machine is in fact a member of the group. In the results I would get {“changed”: false, “skip_reason”: “Conditional result was False”} even when the machine is in the group “ElasticSearch-All” in this example.
Have I just setup the groups incorrectly or do I need to alter the when clause to something else for AWX?
Thanks,
Kam