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:
|
2022-12-26 07:44:31 +01:00
|
|
|
path: "{{ document_root }}"
|
|
|
|
owner: "{{ apache2_owner }}"
|
|
|
|
group: "{{ 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
|
2022-06-25 14:48:38 +02:00
|
|
|
update_cache: true
|
2022-03-13 10:04:35 +01:00
|
|
|
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:
|
2022-12-26 07:56:15 +01:00
|
|
|
src: apache2/2px.info.conf.j2
|
2022-03-12 19:31:54 +01:00
|
|
|
dest: /etc/apache2/sites-available/2px.info.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
|
2022-12-16 20:12:49 +01:00
|
|
|
ansible.builtin.command: a2ensite 2px.info.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
|