aboutsummaryrefslogtreecommitdiff
path: root/infrastructure/roles/web/tasks/main.yaml
blob: 9ef0a151da1e577f40bbab40f7db7b950ec4fb94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: install apache2
  ansible.builtin.package:
    name: apache2
- name: enable mod_md
  ansible.builtin.command:
    cmd: a2enmod md
    creates: /etc/apache2/mods-enabled/md.load
  notify: restart web
- name: enable mod_ssl
  ansible.builtin.command:
    cmd: a2enmod ssl
    creates: /etc/apache2/mods-enabled/ssl.load
  notify: restart web
- name: enable mod_userdir
  ansible.builtin.command:
    cmd: a2enmod userdir
    creates: /etc/apache2/mods-enabled/userdir.load
  notify: restart web
- name: ssl site
  ansible.builtin.copy:
    dest: /etc/apache2/sites-enabled/ssl.conf
    content: |
      MDomain {{ public_hostname_punycode }}
      MDCertificateAgreement accepted

      <VirtualHost *:443>
        ServerName {{ public_hostname_punycode }}
        SSLEngine on
        ServerAdmin {{ admin_email }}
      </VirtualHost>
  notify: restart web