aboutsummaryrefslogtreecommitdiffstats
path: root/playbooks/webserver_internal.yml
blob: 90ffdb311c29fff34f5b7cc953fd80ac9e92cbd1 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
- name: configure internal web servers
  hosts: www1
  tags: apache
  roles:
    - role: common
      tags: common

    - role: apache_vhost
      apache_default_vhost: yes
      apache_config: |
        AliasMatch "^/pub/user/([^/]+)(.*)"  "/nfs/user/$1/pub$2"
        AliasMatch "^/pub/group/([^/]+)(.*)" "/nfs/group/$1/pub$2"

        <Directory "/nfs/user">
          Options -FollowSymLinks +Indexes
          AllowOverride None
          Require all granted
        </Directory>

        <Directory "/nfs/group">
          Options -FollowSymLinks +Indexes
          AllowOverride None
          Require all granted
        </Directory>
  tasks:
    - name: generate index.html
      tags: apache
      copy:
        dest: /var/www/html/index.html
        content: |
          <!DOCTYPE html>
          <html lang="en">
          <head>
            <meta charset="UTF-8">
            <title>{{ domain }} webserver</title>
          </head>
          <body>
            <p>This is the {{ organization }} internal webserver. To access files in user or group
            public directories, try paths like the following:
            <ul>
              <li><tt><a href="/pub/user/username/">/pub/user/username</a></tt></li>
              <li><tt><a href="/pub/group/groupname/">/pub/group/groupname</a></tt></li>
            </ul>
          </body
          </html>