self-hosting/roles/2px-apache2/tasks/main.yml

43 lines
863 B
YAML
Raw Normal View History

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
2021-10-31 15:33:14 +01:00
file:
path: "{{ dir_2px }}"
owner: "{{ owner_2px }}"
group: "{{ group_2px }}"
2021-10-31 15:33:14 +01:00
state: directory
mode: '0775'
2022-03-12 19:31:54 +01:00
2022-03-13 10:04:35 +01:00
- name: Install mod_wsgi
become: true
apt:
name: libapache2-mod-wsgi-py3
state: present
update_cache: yes
notify: Reload apache2 service
2022-03-12 20:06:23 +01:00
- name: Activate modules
become: true
apache2_module:
name: "{{ item }}"
state: present
with_items:
- rewrite
2022-03-12 20:10:27 +01:00
- ssl
2022-03-12 20:06:23 +01:00
- wsgi
notify: Reload apache2 service
2022-03-12 19:31:54 +01:00
- name: Copy vHost conf
become: true
template:
src: 2px.info.conf.j2
dest: /etc/apache2/sites-available/2px.info.conf
notify: Reload apache2 service
- name: Activate vHost
become: true
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