blob: c7aaf75470da25a085176b32a8d84ab9c301ca4f (
plain) (
blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
---
- name: Basic Setup
hosts: sk-testvm
roles:
- role: apt-repo/base
- role: core/base
- role: core/sshd/base
- role: core/zsh
- role: core/ntp
- name: Payload Setup
hosts: sk-testvm
vars:
acme_client: acmetool
roles:
- role: "x509/{{ acme_client }}/base"
- role: nginx/base
post_tasks:
- name: make sure document root directories exist
loop:
- test
- default
file:
path: "/var/www/{{ item }}"
state: directory
- name: install index.html for default server
copy:
dest: /var/www/default/index.html
content: |
<html>
<head>
<title>No Such Site</title>
</head>
<body style="font-family: Helvetica, Arial, Sans-Serif; color: white; background: black;">
<div style="text-align: center; margin-top: 4em; margin-left:auto; margin-right:auto;">
<h2 style="">You have reached testvm.elev8.at, nothing to see here.</h2>
</div>
</body>
</html>
- name: install default vhost
vars:
nginx_vhost:
default: yes
name: nosuchsite
template: generic
tls:
certificate_provider: "{{ acme_client }}"
hsts: no
hostnames:
- testvm.elev8.at
locations:
'/':
root: /var/www/default
index: index.html
include_role:
name: nginx/vhost
- name: install index.html for test server
copy:
dest: /var/www/test/index.html
content: |
<html>
<head>
<title>This is Test</title>
</head>
<body style="font-family: Helvetica, Arial, Sans-Serif; color: white; background: black;">
<div style="text-align: center; margin-top: 4em; margin-left:auto; margin-right:auto;">
<h2 style="">If you can read this the test was successful.</h2>
</div>
</body>
</html>
- name: install test vhost
vars:
nginx_vhost:
name: test
template: generic
tls:
certificate_provider: "{{ acme_client }}"
hsts: no
hostnames:
- test.spreadspace.org
- test.spreadspace.com
- test.spreadspace.net
- test.spreadspace.systems
locations:
'/':
root: /var/www/test
index: index.html
include_role:
name: nginx/vhost
|