Hello,
I’m working on a playbook to install several packages and would like to add logic to handle installing to both Debian-based and RHEL-based distros. To this end, I’ve attempted to use “when_string” and “only_if” to check facts gathered from the servers to determine if apt or yum should be used. However, whenever I add when_string or only_if (separately, not at the same time) to the tasks below, ansible skips these tasks. I’ve tried running ansible-playbook with -vvvv to get more verbose output, but the only output I am able to see is that it skips the task:
TASK: [Install required packages (apt)] ***************************************
skipping: [ubuntuserver]
Here is the playbook: