Hi there, slowly learning ansible here and having issues with a simple conditional. I want to run something against all hosts in group “webservers” that end in “01”. The following doesnt seem to match any hosts (they get skipped), but looks right to me. Any ideas?
Thanks Matt, inventory_hostname.endswith did the job perfectly. Out of interest is there a way of performing an AND in the hosts declaration i.e member of webservers group AND hostname ends in 01. This would prevent unnecessarily gathering facts on servers that we arent interested in. The documentation for patterns seems to suggest that you can perform OR but no mention of AND. Apologies for the basic questions, I’m currently reading up on this stuff! Thanks