2021-10-31 15:33:14 +01:00
|
|
|
---
|
2022-03-12 16:35:32 +01:00
|
|
|
- name: Create 2px directory
|
2022-03-12 16:55:03 +01:00
|
|
|
become: true
|
2022-12-16 20:12:49 +01:00
|
|
|
ansible.builtin.file:
|
2023-12-04 11:31:24 +01:00
|
|
|
path: "/var/www/{{ deux_puissance_x_domain }}"
|
|
|
|
owner: "{{ deux_puissance_x_apache2_owner }}"
|
|
|
|
group: "{{ deux_puissance_x_apache2_group }}"
|
2021-10-31 15:33:14 +01:00
|
|
|
state: directory
|
2022-03-13 11:13:43 +01:00
|
|
|
mode: 0775
|
2022-03-12 19:31:54 +01:00
|
|
|
|
2022-03-13 10:04:35 +01:00
|
|
|
- name: Install mod_wsgi
|
|
|
|
become: true
|
2022-12-16 20:12:49 +01:00
|
|
|
ansible.builtin.apt:
|
2022-03-13 10:04:35 +01:00
|
|
|
name: libapache2-mod-wsgi-py3
|
|
|
|
state: present
|
|
|
|
notify: Reload apache2 service
|
|
|
|
|
2022-03-15 15:31:12 +01:00
|
|
|
- name: Enable wsgi module
|
2022-03-12 20:06:23 +01:00
|
|
|
become: true
|
2022-12-16 20:12:49 +01:00
|
|
|
community.general.apache2_module:
|
2022-03-15 15:31:12 +01:00
|
|
|
name: wsgi
|
2022-03-12 20:06:23 +01:00
|
|
|
state: present
|
|
|
|
notify: Reload apache2 service
|
|
|
|
|
2022-03-12 19:31:54 +01:00
|
|
|
- name: Copy vHost conf
|
|
|
|
become: true
|
2022-12-16 20:12:49 +01:00
|
|
|
ansible.builtin.template:
|
2023-12-04 11:31:24 +01:00
|
|
|
src: apache2/vhost.conf.j2
|
|
|
|
dest: "/etc/apache2/sites-available/{{ deux_puissance_x_domain }}.conf"
|
2022-06-25 14:48:38 +02:00
|
|
|
mode: 0644
|
2022-03-12 19:31:54 +01:00
|
|
|
notify: Reload apache2 service
|
|
|
|
|
|
|
|
- name: Activate vHost
|
|
|
|
become: true
|
2023-12-04 11:31:24 +01:00
|
|
|
ansible.builtin.command: "a2ensite {{ deux_puissance_x_domain }}.conf"
|
2022-03-13 10:21:21 +01:00
|
|
|
register: result
|
|
|
|
changed_when: "'already enabled' not in result.stdout"
|
2022-03-12 19:31:54 +01:00
|
|
|
notify: Reload apache2 service
|