---
|
- name: Simple play with a conditional
|
become: true
|
hosts: server, demoext
|
vars:
|
installstate: present
|
yumdists:
|
- RedHat
|
- Fedora
|
- CentOS
|
ipsdists:
|
- OpenIndiana
|
- OmniOS
|
|
tasks:
|
- name: Install http using yum when on RHEL
|
yum:
|
name: httpd
|
state: '{{ installstate }}'
|
when: ansible_distribution in yumdists
|
|
- name: Install apache-24 using IPS when on OI
|
pkg5:
|
name: pkg:/web/server/apache-24
|
state: '{{ installstate }}'
|
when: ansible_distribution in ipsdists
|
|