Added Apache2 role

This commit is contained in:
Guillem Hernandez Sola
2025-06-18 10:58:24 +02:00
parent 2cbcad9dfb
commit 704b7a721c
3 changed files with 53 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for apache2
#Notifica a la tarea de reinicio de Apache2 si este archivo cambia
- name: Reiniciar Apache2
ansible.builtin.service:
name: apache2 #Nombre del servicio a reiniciar
state: restarted #Reinicia el servicio
when: ansible_facts.services['apache2.service'].state == 'running' #Solo si el servicio está corriendo
#when: ansible_facts.services['apache2'].state == 'running' #Condición para versiones antiguas