2014-04-22 14:34:37 +02:00
|
|
|
---
|
2014-10-10 16:41:19 +02:00
|
|
|
- name: Update apt cache.
|
|
|
|
apt: update_cache=yes cache_valid_time=86400
|
|
|
|
|
2014-10-06 01:58:35 +02:00
|
|
|
- name: Ensure Apache is installed.
|
2014-10-06 02:13:00 +02:00
|
|
|
apt: "name={{ item }} state=installed"
|
2014-04-22 14:34:37 +02:00
|
|
|
with_items: apache_packages
|
|
|
|
|
2014-10-06 01:58:35 +02:00
|
|
|
- name: Configure Apache.
|
2014-10-06 02:13:00 +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-10-06 02:13:00 +02:00
|
|
|
file:
|
|
|
|
src: "{{ apache_server_root }}/mods-available/{{ item }}"
|
|
|
|
dest: "{{ apache_server_root }}/mods-enabled/{{ item }}"
|
|
|
|
state: link
|
2014-04-23 16:47:33 +02:00
|
|
|
with_items: apache_mods_enabled
|
|
|
|
notify: restart apache
|
2014-10-06 01:58:35 +02:00
|
|
|
|
|
|
|
- name: Add apache vhosts configuration.
|
2014-10-06 02:13:00 +02:00
|
|
|
template:
|
|
|
|
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
|
|
|
|
dest: "{{ apache_conf_path }}/sites-available/vhosts.conf"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2014-10-06 01:58:35 +02:00
|
|
|
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
|