ansible-role-nagios/tasks/configure_apache.yml

25 lines
668 B
YAML
Raw Normal View History

2022-10-11 09:19:02 +02:00
---
- name: Ensure configuration file is available to Apache
template:
2022-10-21 09:02:35 +02:00
dest: "/etc/apache2/sites-available/25-{{ item.vhost_name }}.conf"
2022-10-11 09:19:02 +02:00
src: templates/apache_vhost.j2
mode: 0644
backup: yes
2022-10-21 09:02:35 +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-10-21 09:02:35 +02:00
src: "/etc/apache2/sites-available/25-{{ item.vhost_name }}.conf"
path: "/etc/apache2/sites-enabled/25-{{ item.vhost_name }}.conf"
loop: vhosts
2022-10-11 09:19:02 +02:00
notify: Restart Apache2