Jinja Apache2

This commit is contained in:
Guillem Hernandez Sola
2025-06-19 09:15:27 +02:00
parent c750538144
commit d9f9afef19
3 changed files with 17 additions and 17 deletions

View File

@@ -1,16 +0,0 @@
<VirtualHost *:80>
ServerAdmin webmaster@ansible.local
ServerName ansible.local
ServerAlias www.ansible.local
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/ansible.local_error.log
CustomLog ${APACHE_LOG_DIR}/ansible.local_access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

View File

@@ -30,7 +30,7 @@
#Copia el archivo de configuración hosts de Apache2 al directorio correspondiente #Copia el archivo de configuración hosts de Apache2 al directorio correspondiente
- name: Copiar archivo de configuración de hosts de Apache2 - name: Copiar archivo de configuración de hosts de Apache2
ansible.builtin.copy: ansible.builtin.copy:
src: ../files/hosts.conf #Ruta al archivo de configuración local src: ../templates/hosts.con.j2 #Ruta al archivo de configuración local
dest: /etc/apache2/sites-available/000-default.conf #Ruta de destino en el servidor dest: /etc/apache2/sites-available/000-default.conf #Ruta de destino en el servidor
owner: www-data #Propietario del archivo owner: www-data #Propietario del archivo
group: www-data #Grupo del archivo group: www-data #Grupo del archivo

View File

@@ -0,0 +1,16 @@
<VirtualHost *:80>
ServerAdmin {{ ansible_hostname }}@{{ ansible_domain }}
ServerName {{ ansible_hostname }}.{{ ansible_domain }}
ServerAlias {{ ansible_hostname }}.{{ ansible_domain }}
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/{{ ansible_hostname }}_error.log
CustomLog ${APACHE_LOG_DIR}/{{ ansible_hostname }}.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>