2022-10-11 09:19:02 +02:00
|
|
|
---
|
|
|
|
- name: Ensure configuration file is available to Apache
|
|
|
|
template:
|
2022-12-08 13:00:05 +01:00
|
|
|
dest: "/etc/apache2/sites-available/25-{{ item.vhostname }}.conf"
|
2022-10-11 09:19:02 +02:00
|
|
|
src: templates/apache_vhost.j2
|
|
|
|
mode: 0644
|
|
|
|
backup: yes
|
2022-10-21 09:05:06 +02:00
|
|
|
loop: "{{ vhosts }}"
|
2022-10-11 09:19:02 +02:00
|
|
|
|
|
|
|
- name: Create auth user file
|
|
|
|
htpasswd:
|
|
|
|
path: "{{ auth_user_file }}"
|
|
|
|
name: "{{ nagios_admin_user }}"
|
|
|
|
password: "{{ nagios_admin_password }}"
|
|
|
|
owner: root
|
|
|
|
group: www-data
|
|
|
|
mode: 0640
|
|
|
|
|
|
|
|
- name: Ensure vhost is enabled
|
|
|
|
file:
|
|
|
|
state: link
|
2022-12-08 13:00:05 +01:00
|
|
|
src: "/etc/apache2/sites-available/25-{{ item.vhostname }}.conf"
|
|
|
|
path: "/etc/apache2/sites-enabled/25-{{ item.vhostname }}.conf"
|
2022-10-21 09:05:06 +02:00
|
|
|
loop: "{{ vhosts }}"
|
2022-12-08 13:00:05 +01:00
|
|
|
notify: Restart Apache2
|