ansible-role-apache/tasks/configure-Debian.yml
Guillaume Dedrie b13cb7d4ba Prevent task symlink vhost for Debian to failed.
When vhost has not been created (using apache_create_vhosts: no), the
tasks should not be executed, otherwise it'll failed as the vhosts.conf
file has not been created and cannot been linked.
2014-11-04 18:02:42 +01:00

34 lines
971 B
YAML

---
- 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
- 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: 0644
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
when: apache_create_vhosts