Run roles on Ubuntu hosts only

I think it's a good idea to only run/include a role if the remote host
is running Ubuntu OS - doesn't hurt to do an extra check even though
the README clearly assumes so.

Signed-off-by: James Oguya <oguyajames@gmail.com>
This commit is contained in:
James Oguya 2015-06-27 20:50:09 +03:00
parent 75cda0a066
commit 95e702e388
No known key found for this signature in database
GPG Key ID: 0F674923EA471030

10
web.yml
View File

@ -6,11 +6,11 @@
user: provisioning user: provisioning
sudo: yes sudo: yes
roles: roles:
- common - { role: common, when: ansible_distribution == 'Ubuntu' }
- mariadb - { role: mariadb, when: ansible_distribution == 'Ubuntu' }
- nginx - { role: nginx, when: ansible_distribution == 'Ubuntu' }
- php5-fpm - { role: php5-fpm, when: ansible_distribution == 'Ubuntu' }
- munin - { role: munin, when: ansible_distribution == 'Ubuntu' }
vars_files: vars_files:
- vars/ipsets.yml - vars/ipsets.yml
- "vars/{{ ansible_distribution }}.yml" - "vars/{{ ansible_distribution }}.yml"