ansible-role-apache/tasks/setup-Debian.yml

41 lines
1.1 KiB
YAML
Raw Normal View History

---
2014-10-10 16:41:19 +02:00
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=86400
- name: Ensure Apache is installed.
2014-10-06 02:13:00 +02:00
apt: "name={{ item }} state=installed"
with_items: apache_packages
- 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
with_items: apache_ports_configuration_items
notify: restart apache
- 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
with_items: apache_mods_enabled
notify: restart apache
- 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
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