source: darkpeak-services/roles/apache2/tasks/configure-apache-site.yml @ b6bf17d3

ansiblekeycloakmatrixpleroma
Last change on this file since b6bf17d3 was b6bf17d3, checked in by Mat Booth <mat.booth@…>, 3 years ago

apache: minor simplification

  • Property mode set to 100644
File size: 1.4 KB
Line 
1- name: Create site directories
2  file:
3    state: directory
4    path:  "{{ item.path }}"
5    group: "{{ item.group }}"
6    owner: "{{ item.owner }}"
7    mode:  "{{ item.mode }}"
8  with_items:
9    - { path: '/var/log/apache2/{{ service_name }}', group: 'adm', owner: 'www-data', mode: '0750' }
10    - { path: '{{ web_root }}', group: 'www-data', owner: 'root', mode: '0751' }
11  notify:
12    - reload apache2
13
14# The default vhost *must* be the first lexigraphically, so for the default service
15# we add a filename prefix of '0-' to ensure that is the case
16
17- name: Install vhost
18  template:
19    src: ../../apache2/templates/apache.vhost.conf.j2
20    dest: "/etc/apache2/sites-available/{{ '0-default' if service_name == 'default' else service_name }}.conf"
21    owner: root
22    group: root
23    mode: 0644
24  notify:
25    - reload apache2
26
27- name: Enable vhost
28  file:
29    src: "/etc/apache2/sites-available/{{ '0-default' if service_name == 'default' else service_name }}.conf"
30    dest: "/etc/apache2/sites-enabled/{{ '0-default' if service_name == 'default' else service_name }}.conf"
31    state: link
32  notify:
33    - reload apache2
34
35# This file is supplied by the calling role, and included in the apache configuration
36# by the above vhost file
37
38- name: Install custom site config
39  template:
40    src: apache.incl.conf.j2
41    dest: "/etc/apache2/includes/{{ service_name}}.incl.conf"
42    owner: root
43    group: root
44    mode: 0644
45  notify:
46    - reload apache2
Note: See TracBrowser for help on using the repository browser.