ansible-role-apache/tasks/main.yml
2014-10-05 19:13:00 -05:00

35 lines
940 B
YAML

---
- 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'
- include: setup-Debian.yml
when: ansible_os_family == 'Debian'
- name: Add apache vhosts configuration.
template:
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
dest: "{{ apache_conf_path }}/vhosts.conf"
owner: root
group: root
mode: 0644
notify: restart apache
when: apache_create_vhosts
- name: Ensure Apache is started and enabled on boot.
service:
name: "{{ apache_daemon }}"
state: started
enabled: yes