2014-04-22 14:34:37 +02:00
|
|
|
---
|
2014-05-10 20:33:06 +02:00
|
|
|
- name: Ensure Apache is installed (Debian).
|
2014-04-22 14:34:37 +02:00
|
|
|
apt: >
|
|
|
|
name={{ item }}
|
|
|
|
state=installed
|
|
|
|
with_items: apache_packages
|
|
|
|
|
2014-05-10 20:33:06 +02:00
|
|
|
- name: Configure Apache (Debian).
|
2014-04-22 14:34:37 +02:00
|
|
|
lineinfile: >
|
|
|
|
dest="{{ apache_server_root }}/ports.conf"
|
|
|
|
regexp="{{ item.regexp }}"
|
|
|
|
line="{{ item.line }}"
|
|
|
|
state=present
|
|
|
|
with_items:
|
|
|
|
- {
|
|
|
|
regexp: "^Listen ",
|
|
|
|
line: "Listen {{ apache_listen_port }}"
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
regexp: "^NameVirtualHost ",
|
|
|
|
line: "NameVirtualHost *:{{ apache_listen_port }}"
|
|
|
|
}
|
|
|
|
notify: restart apache
|
2014-04-23 16:47:33 +02:00
|
|
|
|
2014-05-10 20:33:06 +02:00
|
|
|
- name: Enable Apache mods (Debian).
|
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
|