From 83ab160cff53d7ca43db4af04d33adb4eb5acbd3 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 5 Oct 2014 08:02:17 -0500 Subject: [PATCH] Issue #5: Allow apache_packages to be overridden. --- tasks/main.yml | 10 ++++++++++ vars/{Debian.yml => Debian-precise.yml} | 2 +- vars/Debian-trusty.yml | 9 +++++++++ vars/RedHat.yml | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) rename vars/{Debian.yml => Debian-precise.yml} (91%) create mode 100644 vars/Debian-trusty.yml diff --git a/tasks/main.yml b/tasks/main.yml index 28a4db5..db0d99e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,16 @@ --- - name: Include OS-specific variables. include_vars: "{{ ansible_os_family }}.yml" + when: ansible_os_family == 'RedHat' + +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}-{{ ansible_lsb.codename }}.yml" + when: ansible_os_family == 'Debian' + +- name: Define apache_packages. + set_fact: + apache_packages: "{{ __apache_packages | list }}" + when: apache_packages is not defined - include: setup-RedHat.yml when: ansible_os_family == 'RedHat' diff --git a/vars/Debian.yml b/vars/Debian-precise.yml similarity index 91% rename from vars/Debian.yml rename to vars/Debian-precise.yml index d2d1706..62f51e2 100644 --- a/vars/Debian.yml +++ b/vars/Debian-precise.yml @@ -2,7 +2,7 @@ apache_daemon: apache2 apache_server_root: /etc/apache2 apache_conf_path: /etc/apache2/sites-enabled -apache_packages: +__apache_packages: - apache2 - apache2-mpm-prefork - apache2-utils diff --git a/vars/Debian-trusty.yml b/vars/Debian-trusty.yml new file mode 100644 index 0000000..cfcaa8a --- /dev/null +++ b/vars/Debian-trusty.yml @@ -0,0 +1,9 @@ +--- +apache_daemon: apache2 +apache_server_root: /etc/apache2 +apache_conf_path: /etc/apache2/sites-enabled +__apache_packages: + - apache2 + - apache2-mpm-prefork + - apache2-utils + - apache2-bin diff --git a/vars/RedHat.yml b/vars/RedHat.yml index 04a0e7b..e69d549 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -2,7 +2,7 @@ apache_daemon: httpd apache_server_root: /etc/httpd apache_conf_path: /etc/httpd/conf.d -apache_packages: +__apache_packages: - httpd - httpd-devel - mod_ssl