2014-04-22 14:34:37 +02:00
|
|
|
---
|
2014-10-06 01:58:35 +02:00
|
|
|
- name: Ensure Apache is installed.
|
2014-04-22 14:34:37 +02:00
|
|
|
apt: >
|
|
|
|
name={{ item }}
|
|
|
|
state=installed
|
|
|
|
with_items: apache_packages
|
|
|
|
|
2014-10-06 01:58:35 +02:00
|
|
|
- name: Configure Apache.
|
2014-04-22 14:34:37 +02:00
|
|
|
lineinfile: >
|
|
|
|
dest="{{ apache_server_root }}/ports.conf"
|
|
|
|
regexp="{{ item.regexp }}"
|
|
|
|
line="{{ item.line }}"
|
|
|
|
state=present
|
2014-10-06 01:58:35 +02:00
|
|
|
with_items: apache_ports_configuration_items
|
2014-04-22 14:34:37 +02:00
|
|
|
notify: restart apache
|
2014-04-23 16:47:33 +02:00
|
|
|
|
2014-10-06 01:58:35 +02:00
|
|
|
- name: Enable Apache mods.
|
2014-04-23 16:47:33 +02:00
|
|
|
file: >
|
2014-04-23 16:49:55 +02:00
|
|
|
src={{ apache_server_root }}/mods-available/{{ item }}
|
|
|
|
dest={{ apache_server_root }}/mods-enabled/{{ item }}
|
2014-04-23 16:47:33 +02:00
|
|
|
state=link
|
|
|
|
with_items: apache_mods_enabled
|
|
|
|
notify: restart apache
|
2014-10-06 01:58:35 +02:00
|
|
|
|
|
|
|
- name: Add apache vhosts configuration.
|
|
|
|
template: >
|
|
|
|
src=vhosts-{{ apache_vhosts_version }}.conf.j2
|
|
|
|
dest={{ apache_conf_path }}/sites-available/vhosts.conf
|
|
|
|
owner=root group=root mode=644
|
|
|
|
notify: restart apache
|
|
|
|
when: apache_create_vhosts
|
|
|
|
|
|
|
|
- name: Add vhost symlink in sites-enabled.
|
|
|
|
file:
|
|
|
|
src: "{{ apache_conf_path }}/sites-available/vhosts.conf"
|
|
|
|
dest: "{{ apache_conf_path }}/sites-enabled/vhosts.conf"
|
|
|
|
state: link
|