Browse Source

Define role klingt.net that serves a static page

remove-logs
Andreas Linz 3 years ago
parent
commit
5f7a970299
4 changed files with 37 additions and 0 deletions
  1. +2
    -0
      playbook.yml
  2. +13
    -0
      roles/caddy/templates/Caddyfile.tmpl
  3. +12
    -0
      roles/klingt.net/tasks/main.yml
  4. +10
    -0
      roles/klingt.net/templates/index.html.tmpl

+ 2
- 0
playbook.yml View File

@ -8,6 +8,7 @@
caddy_email: "{{ user_email }}"
caddy_restic_user: alinz
jupyter_password: 'sha1:7ba04f8b7db3:b647b05c2e317857828f9f4fc929b08d485f9c76'
web_root: /var/web
vars_files:
- vault_vars.yml
roles:
@ -18,6 +19,7 @@
- caddy
- prometheus
- grafana
- klingt.net
tasks:
- name: Set version number
delegate_to: localhost

+ 13
- 0
roles/caddy/templates/Caddyfile.tmpl View File

@ -1,3 +1,16 @@
{{ domain }}:80,
www.{{ domain }}:80 {
import common.caddy
redir https://www.{{ domain }}{uri}
}
{{ domain }}:443,
www.{{ domain }}:443 {
import common.caddy
tls self_signed
root {{ web_root }}/{{ domain }}
}
git.{{ domain }}:80 {
import common.caddy
redir https://git.{{ domain }}{uri}

+ 12
- 0
roles/klingt.net/tasks/main.yml View File

@ -0,0 +1,12 @@
- name: "Create {{ web_root }}"
file:
state: directory
path: "{{ web_root }}/{{ domain }}"
mode: 0755
become: true
- name: Create index page
template:
src: index.html.tmpl
dest: "{{ web_root }}/{{ domain }}/index.html"
mode: 0644
become: true

+ 10
- 0
roles/klingt.net/templates/index.html.tmpl View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head></head>
<body style="text-align: center; background-color: black; color: white;">
<h1>I'll be back.</h1>
<div style="width:100%;height:0;padding-bottom:53%;position:relative;">
<iframe src="https://giphy.com/embed/JDKxRN0Bvmm2c" width="100%" height="100%" style="position:absolute" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
</div>
</body>
</html>

Loading…
Cancel
Save