Specific role for debian (#4)

* Added specific role for Debian using backports repository

* Moved ubuntu to specific file

* Changed ansible_os_family to ansible_distribution for Debian/Ubuntu. Fixed my mistake where setup-Ubuntu.yml was a setup-RedHat copy
This commit is contained in:
d4rkstar 2016-08-31 02:19:02 +02:00 committed by Jeff Geerling
parent bebd370b83
commit 2828125e67
3 changed files with 16 additions and 4 deletions

View File

@ -3,5 +3,8 @@
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include: setup-Ubuntu.yml
when: ansible_distribution == 'Ubuntu'
- include: setup-Debian.yml
when: ansible_os_family == 'Debian'
when: ansible_distribution == 'Debian'

View File

@ -1,9 +1,9 @@
---
- name: Add ansible repository.
apt_repository: repo='ppa:ansible/ansible'
- name: Enable Backports repository
apt_repository: repo='deb http://ftp.debian.org/debian {{ansible_distribution_release}}-backports main' state=present filename={{ansible_distribution_release}}_backports
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=86400
- name: Install Ansible.
apt: name=ansible state=installed
apt: name=ansible state=installed default_release={{ansible_distribution_release}}-backports

9
tasks/setup-Ubuntu.yml Normal file
View File

@ -0,0 +1,9 @@
---
- name: Add ansible repository.
apt_repository: repo='ppa:ansible/ansible'
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=86400
- name: Install Ansible.
apt: name=ansible state=installed