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

38 lines
806 B
YAML

---
- name: Create 2px directory
become: true
file:
path: "{{ dir_2px }}"
owner: "{{ owner_2px }}"
group: "{{ group_2px }}"
state: directory
mode: 0775
- name: Install mod_wsgi
become: true
apt:
name: libapache2-mod-wsgi-py3
state: present
update_cache: yes
notify: Reload apache2 service
- name: Enable wsgi module
become: true
apache2_module:
name: wsgi
state: present
notify: Reload apache2 service
- 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
register: result
changed_when: "'already enabled' not in result.stdout"
notify: Reload apache2 service