mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-11-06 22:23:29 +01:00
24 lines
500 B
YAML
24 lines
500 B
YAML
|
---
|
||
|
- 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
|