Ansible Tower playbook displays too much info
by mramirez81 from LinuxQuestions.org on (#5M0D3)
I have an Ansible playbook below that simply checks if the firewalld service is running. We have developers in our test environment who love to shut it off. Mgmt policy doesn't let us restrict this, but security wants firewall running. Regardless, I set up a notification in Tower to send the output of the template, which runs every Monday at noon, and the output looks like this. I go through the email and find the "skipped": 1 entries, which means the firewalld is not running. But I'd like to get the output of ONLY the servers that do not have the service running. Don't know if this is a change in the notification or the playbook?
Playbook:
---
- hosts: all
tasks:
- name: check if firewalld is running
command: systemctl status firewalld
args:
warn: false
Output:
"hosts": {
"CDV-SERVER1": {
"failed": false,
"changed": 0,
"dark": 0,
"failures": 0,
"ok": 3,
"processed": 1,
"skipped": 0,
"rescued": 0,
"ignored": 0
},
"CUV-SERVER2": {
"failed": false,
"changed": 0,
"dark": 0,
"failures": 0,
"ok": 3,
"processed": 1,
"skipped": 0,
"rescued": 0,
"ignored": 0
},
Playbook:
---
- hosts: all
tasks:
- name: check if firewalld is running
command: systemctl status firewalld
args:
warn: false
Output:
"hosts": {
"CDV-SERVER1": {
"failed": false,
"changed": 0,
"dark": 0,
"failures": 0,
"ok": 3,
"processed": 1,
"skipped": 0,
"rescued": 0,
"ignored": 0
},
"CUV-SERVER2": {
"failed": false,
"changed": 0,
"dark": 0,
"failures": 0,
"ok": 3,
"processed": 1,
"skipped": 0,
"rescued": 0,
"ignored": 0
},