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

32 lines
706 B
YAML
Raw Normal View History

---
- name: Ensure Apache is installed.
apt: >
name={{ item }}
state=installed
with_items: apache_packages
- name: Configure Apache.
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
- name: Enable Apache mods.
file: >
src=/etc/apache2/mods-available/{{ item }}
dest=/etc/apache2/mods-enabled/{{ item }}
state=link
with_items: apache_mods_enabled
notify: restart apache