mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-12-22 11:00:18 +01:00
31 lines
757 B
YAML
31 lines
757 B
YAML
---
|
|
- name: Ensure Apache is installed (Debian).
|
|
apt: >
|
|
name={{ item }}
|
|
state=installed
|
|
with_items: apache_packages
|
|
|
|
- name: Configure Apache (Debian).
|
|
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 (Debian).
|
|
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
|