xxxxxxxxxx
[rootmaniprabu-10-0-0-20 ~]# cat abc.yml
---
- hosts: localhost
gather_facts: no
tasks:
- name: verify httpd version
command: /usr/sbin/httpd -v
register: version
ignore_errors: True
- name: print httpd version
debug:
msg: "{{ version }}"
when: "version.rc == 0"
- name: install httpd
yum: name=httpd state=present
when: "version.rc != 0 "