source: darkpeak-services/roles/apache2/tasks/main.yml @ 90966788

keycloak
Last change on this file since 90966788 was 90966788, checked in by Mat Booth <mbooth@…>, 12 months ago

#63 - Fix wiki login issues by ensuring php 7.3 versions of all our deps are installed

  • Property mode set to 100644
File size: 1.9 KB
Line 
1- name: Install web server packages
2  apt:
3    name: "{{ item }}"
4    state: present
5    update_cache: yes
6    cache_valid_time: 10800   # 3 hours
7  with_items:
8    - apache2
9    - libapache2-mod-php7.3
10  notify:
11    - reload apache2
12
13- name: Create directory for custom site config
14  file:
15    state: directory
16    path:  /etc/apache2/includes
17    group: root
18    owner: root
19    mode:  0755
20
21- name: Disable and remove default vhost
22  file:
23    path: "{{ item }}"
24    state: absent
25  with_items:
26    - /etc/apache2/sites-enabled/000-default.conf
27    - /etc/apache2/sites-available/000-default.conf
28    - /etc/apache2/sites-available/default-ssl.conf
29    - /var/www/html
30  notify:
31    - reload apache2
32
33- name: Install main apache configuration
34  copy:
35    src: "{{ item.src }}.conf"
36    dest: "/etc/apache2/{{ item.dest }}.conf"
37    group: root
38    owner: root
39    mode: 0644
40  with_items:
41    - { src: apache2, dest: apache2 }
42    - { src: mods/dir, dest: mods-available/dir }
43    - { src: mods/headers, dest: mods-available/headers }
44    - { src: mods/include, dest: mods-available/include }
45    - { src: mods/mime, dest: mods-available/mime }
46    - { src: mods/ssl, dest: mods-available/ssl }
47  notify:
48    - reload apache2
49
50- name: Enable standard apache modules
51  apache2_module:
52    name: "{{ item }}"
53    state: present
54    force: yes
55  with_items:
56    - autoindex
57    - deflate
58    - dir
59    - headers
60    - include
61    - mime
62    - proxy_http
63    - ssl
64    - rewrite
65    - php7.3
66  notify:
67    - reload apache2
68
69- name: Configure apache for default site
70  include: configure-apache-site.yml
71
72- name: Install placeholder index for default site
73  copy:
74    src: index.html
75    dest: "{{ web_root }}/index.html"
76    group: www-data
77    owner: root
78    mode: 0640
79
80- name: TODO - Add users to the www-data group instead of setting 777 here
81  file:
82    state: directory
83    path:  "{{ web_root }}"
84    group: www-data
85    owner: root
86    mode:  0777
Note: See TracBrowser for help on using the repository browser.