From 46026b274a67f9c048da0713dad9b03de94deec2 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 5 Jan 2015 09:04:36 -0600 Subject: [PATCH] Update role to use distro-specific includes. --- tasks/main.yml | 17 +++-------------- tasks/setup-Debian.yml | 9 +++++++++ tasks/setup-RedHat.yml | 3 +++ 3 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 tasks/setup-Debian.yml create mode 100644 tasks/setup-RedHat.yml diff --git a/tasks/main.yml b/tasks/main.yml index 8d70a5d..066e8b3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,18 +1,7 @@ --- -# RedHat installation. -- name: Install Ansible (RedHat). - yum: pkg=ansible state=installed enablerepo=epel +# Setup/install tasks. +- include: setup-RedHat.yml when: ansible_os_family == 'RedHat' -# Debian installation. -- name: Add rquillo repository (Debian). - apt_repository: repo='ppa:ansible/ansible' - when: ansible_os_family == 'Debian' - -- name: Update apt cache (Debian). - apt: update_cache=yes cache_valid_time=86400 - when: ansible_os_family == 'Debian' - -- name: Install Ansible (Debian). - apt: pkg=ansible state=installed +- include: setup-Debian.yml when: ansible_os_family == 'Debian' diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml new file mode 100644 index 0000000..29872f0 --- /dev/null +++ b/tasks/setup-Debian.yml @@ -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 diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml new file mode 100644 index 0000000..28696ab --- /dev/null +++ b/tasks/setup-RedHat.yml @@ -0,0 +1,3 @@ +--- +- name: Install Ansible. + yum: name=ansible state=installed enablerepo=epel