2016-02-01 10:37:57 +01:00
|
|
|
---
|
|
|
|
- name: Configure Apache.
|
|
|
|
lineinfile:
|
2016-02-01 11:17:20 +01:00
|
|
|
dest: "{{ apache_server_root }}/listen.conf"
|
2016-02-01 10:37:57 +01:00
|
|
|
regexp: "{{ item.regexp }}"
|
|
|
|
line: "{{ item.line }}"
|
|
|
|
state: present
|
2020-08-20 19:22:09 +02:00
|
|
|
mode: 0644
|
2016-02-29 06:32:02 +01:00
|
|
|
with_items: "{{ apache_ports_configuration_items }}"
|
2016-02-01 10:37:57 +01:00
|
|
|
notify: restart apache
|
|
|
|
|
|
|
|
- name: Check whether certificates defined in vhosts exist.
|
|
|
|
stat: path={{ item.certificate_file }}
|
|
|
|
register: apache_ssl_certificates
|
2016-02-29 06:32:02 +01:00
|
|
|
with_items: "{{ apache_vhosts_ssl }}"
|
2016-02-01 10:37:57 +01:00
|
|
|
|
|
|
|
- name: Add apache vhosts configuration.
|
|
|
|
template:
|
2016-09-02 13:37:41 +02:00
|
|
|
src: "{{ apache_vhosts_template }}"
|
2016-02-01 10:37:57 +01:00
|
|
|
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify: restart apache
|
2019-07-23 22:01:49 +02:00
|
|
|
when: apache_create_vhosts | bool
|