2014-10-22 20:41:14 +02:00
|
|
|
---
|
|
|
|
- name: Configure Apache.
|
|
|
|
lineinfile:
|
|
|
|
dest: "{{ apache_server_root }}/ports.conf"
|
|
|
|
regexp: "{{ item.regexp }}"
|
|
|
|
line: "{{ item.line }}"
|
|
|
|
state: present
|
|
|
|
with_items: apache_ports_configuration_items
|
|
|
|
notify: restart apache
|
|
|
|
|
|
|
|
- name: Enable Apache mods.
|
|
|
|
file:
|
|
|
|
src: "{{ apache_server_root }}/mods-available/{{ item }}"
|
|
|
|
dest: "{{ apache_server_root }}/mods-enabled/{{ item }}"
|
|
|
|
state: link
|
|
|
|
with_items: apache_mods_enabled
|
|
|
|
notify: restart apache
|
|
|
|
|
2015-05-31 23:01:27 +02:00
|
|
|
- name: Disable Apache mods.
|
|
|
|
file:
|
|
|
|
path: "{{ apache_server_root }}/mods-enabled/{{ item }}"
|
|
|
|
state: absent
|
|
|
|
with_items: apache_mods_disabled
|
|
|
|
notify: restart apache
|
|
|
|
|
2014-10-22 20:41:14 +02:00
|
|
|
- name: Add apache vhosts configuration.
|
|
|
|
template:
|
|
|
|
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
|
2015-01-08 18:29:36 +01:00
|
|
|
dest: "{{ apache_conf_path }}/sites-available/{{ apache_vhosts_filename }}"
|
2014-10-22 20:41:14 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: restart apache
|
|
|
|
when: apache_create_vhosts
|
|
|
|
|
|
|
|
- name: Add vhost symlink in sites-enabled.
|
|
|
|
file:
|
2015-01-08 18:29:36 +01:00
|
|
|
src: "{{ apache_conf_path }}/sites-available/{{ apache_vhosts_filename }}"
|
|
|
|
dest: "{{ apache_conf_path }}/sites-enabled/{{ apache_vhosts_filename }}"
|
2014-10-22 20:41:14 +02:00
|
|
|
state: link
|
2014-11-04 18:02:42 +01:00
|
|
|
when: apache_create_vhosts
|
2015-01-28 13:54:09 +01:00
|
|
|
|
|
|
|
- name: Remove default vhost symlink in sites-enabled.
|
|
|
|
file:
|
|
|
|
path: "{{ apache_conf_path }}/sites-enabled/{{ apache_default_vhost_filename }}"
|
|
|
|
state: absent
|
|
|
|
when: apache_remove_default_vhost
|