Skip to content

Commit

Permalink
Issue #5: Allow apache_packages to be overridden.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Oct 5, 2014
1 parent a59400e commit 83ab160
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions 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

This comment has been minimized.

Copy link
@seschwar

seschwar Oct 15, 2014

Contributor

Wouldn't it be easier to define apache_packages in defaults/main.yml. The variables there get overridden automatically if they are redefined in a different place?


- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
Expand Down
2 changes: 1 addition & 1 deletion vars/Debian.yml → vars/Debian-precise.yml
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion vars/RedHat.yml
Expand Up @@ -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
Expand Down

0 comments on commit 83ab160

Please sign in to comment.