Hi All,
I am trying to prepare Ansible scripts to check remote hosts for certain things like - OS version, free disk space etc. I am able to create tasks for each of this check as Ansible already have a great support for that, but i am stuck at a place on how to create a final report kind of thing for all tasks. I have multiple ways to do this:
Either, simple print the outcome of checking tasks
- name: Make drive is present
win_stat: path="{{path}}"
register: drive
Problem with this approach is that the actual reporting is lost in between all log data of Ansible task execution.
Let a task fail at the point where the check fails
- fail: msg="OS version mismatch"
when: '"Windows Server 2012 R2" not in ansible_os_name'
Problem in this approach is that it will not be a exact reporting of all checks.
So, does anyone has an idea how i can generate a report in the end after collecting output of multiple commands ?