commit | author | age
|
97d9af
|
1 |
--- |
SU |
2 |
- name: Simple play with a conditional |
|
3 |
become: true |
|
4 |
hosts: server, demoext |
|
5 |
vars: |
|
6 |
installstate: present |
|
7 |
yumdists: |
|
8 |
- RedHat |
|
9 |
- Fedora |
|
10 |
- CentOS |
|
11 |
ipsdists: |
|
12 |
- OpenIndiana |
|
13 |
- OmniOS |
|
14 |
|
|
15 |
tasks: |
|
16 |
- name: Install http using yum when on RHEL |
|
17 |
yum: |
|
18 |
name: httpd |
|
19 |
state: '{{ installstate }}' |
|
20 |
when: ansible_distribution in yumdists |
|
21 |
|
|
22 |
- name: Install apache-24 using IPS when on OI |
|
23 |
pkg5: |
|
24 |
name: pkg:/web/server/apache-24 |
|
25 |
state: '{{ installstate }}' |
|
26 |
when: ansible_distribution in ipsdists |
|
27 |
|