summaryrefslogtreecommitdiff
path: root/roles/elevate/liquid-truth
diff options
context:
space:
mode:
Diffstat (limited to 'roles/elevate/liquid-truth')
-rw-r--r--roles/elevate/liquid-truth/defaults/main.yml2
-rw-r--r--roles/elevate/liquid-truth/handlers/main.yml5
-rw-r--r--roles/elevate/liquid-truth/tasks/main.yml24
-rw-r--r--roles/elevate/liquid-truth/tasks/mongodb.yml21
-rw-r--r--roles/elevate/liquid-truth/tasks/nginx.yml78
-rw-r--r--roles/elevate/liquid-truth/templates/nginx.conf.j248
6 files changed, 0 insertions, 178 deletions
diff --git a/roles/elevate/liquid-truth/defaults/main.yml b/roles/elevate/liquid-truth/defaults/main.yml
deleted file mode 100644
index 4770c5fb..00000000
--- a/roles/elevate/liquid-truth/defaults/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-liquid_truth_srv_disk_size: 12G
diff --git a/roles/elevate/liquid-truth/handlers/main.yml b/roles/elevate/liquid-truth/handlers/main.yml
deleted file mode 100644
index 6deed0cd..00000000
--- a/roles/elevate/liquid-truth/handlers/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: restart nginx
- service:
- name: nginx
- state: restarted
diff --git a/roles/elevate/liquid-truth/tasks/main.yml b/roles/elevate/liquid-truth/tasks/main.yml
deleted file mode 100644
index 7f4749ae..00000000
--- a/roles/elevate/liquid-truth/tasks/main.yml
+++ /dev/null
@@ -1,24 +0,0 @@
----
-- name: create logical volume for /srv
- lvol:
- vg: "{{ host_name }}"
- lv: "srv"
- size: "{{ liquid_truth_srv_disk_size }}"
-
-- name: create filesystem
- filesystem:
- fstype: xfs
- dev: "/dev/mapper/{{ host_name | replace('-', '--') }}-srv"
-
-- name: mount filesytem
- mount:
- src: "/dev/mapper/{{ host_name | replace('-', '--') }}-srv"
- path: /srv
- fstype: xfs
- state: mounted
-
-- name: install and configure mongodb
- import_tasks: mongodb.yml
-
-- name: install and configure nginx
- import_tasks: nginx.yml
diff --git a/roles/elevate/liquid-truth/tasks/mongodb.yml b/roles/elevate/liquid-truth/tasks/mongodb.yml
deleted file mode 100644
index 244d9849..00000000
--- a/roles/elevate/liquid-truth/tasks/mongodb.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-- name: create mongodb data directory
- file:
- name: /srv/mongodb
- state: directory
-
-- name: create bind mount for mongodb
- mount:
- src: /srv/mongodb
- path: /var/lib/mongodb
- fstype: none
- opts: bind,defaults
- state: mounted
-
-- name: install mongodb server
- apt:
- name:
- - mongodb
- - mongo-tools
- - python-pymongo
- state: present
diff --git a/roles/elevate/liquid-truth/tasks/nginx.yml b/roles/elevate/liquid-truth/tasks/nginx.yml
deleted file mode 100644
index a5bd31d7..00000000
--- a/roles/elevate/liquid-truth/tasks/nginx.yml
+++ /dev/null
@@ -1,78 +0,0 @@
----
-- name: install nginx
- apt:
- name: nginx-light
- state: present
-
-- name: remove nginx default config
- file:
- name: /etc/nginx/sites-enabled/default
- state: absent
- notify: restart nginx
-
-- name: install nginx config snippets
- loop:
- - ssl
- - hsts
- copy:
- src: "{{ global_files_dir }}/common/nginx-snippets/{{ item }}.conf"
- dest: /etc/nginx/snippets/
- notify: restart nginx
-
-- name: generate Diffie-Hellman parameters
- openssl_dhparam:
- path: /etc/ssl/dhparams.pem
- size: 2048
- notify: restart nginx
-
-- name: install nginx config
- template:
- src: nginx.conf.j2
- dest: /etc/nginx/sites-available/liquid-truth
- notify: restart nginx
-
-- name: check if acme certs already exist
- loop: "{{ liquid_truth_hostnames }}"
- stat:
- path: "/var/lib/acme/live/{{ item }}"
- register: acme_cert_stat
-
-- name: set acmecert_missing_hostnames variable
- set_fact:
- acmecert_missing_hostnames: "{{ acme_cert_stat.results | acme_cert_nonexistent(liquid_truth_hostnames) }}"
-
-- name: link nonexistent hostnames to self-signed interim cert
- when: acmecert_missing_hostnames | length > 0
- block:
- - name: get id of existing selfsigned interim certificate
- command: cat /var/lib/acme/.selfsigned-interim-cert
- changed_when: false
- check_mode: false
- register: selfsigned_interim_cert_id
-
- - name: set selfsigned_interim_cert_id variable
- set_fact:
- selfsigned_interim_cert_id: "{{ selfsigned_interim_cert_id.stdout }}"
-
- - name: link to snakeoil cert for nonexistent hostnames
- loop: "{{ acmecert_missing_hostnames }}"
- file:
- src: "../certs/{{ selfsigned_interim_cert_id }}"
- dest: "/var/lib/acme/live/{{ item }}"
- state: link
-
-- name: enable vhost config using acme cert
- file:
- src: ../sites-available/liquid-truth
- dest: /etc/nginx/sites-enabled/liquid-truth
- state: link
-
-- name: make sure nginx config has been (re)loaded
- meta: flush_handlers
-
-- name: get certificate using acmetool
- import_role:
- name: acmetool/cert
- vars:
- acmetool_cert_name: "{{ liquid_truth_hostnames[0] }}"
- acmetool_cert_hostnames: "{{ liquid_truth_hostnames }}"
diff --git a/roles/elevate/liquid-truth/templates/nginx.conf.j2 b/roles/elevate/liquid-truth/templates/nginx.conf.j2
deleted file mode 100644
index e3cdf575..00000000
--- a/roles/elevate/liquid-truth/templates/nginx.conf.j2
+++ /dev/null
@@ -1,48 +0,0 @@
-# used for websockets
-# set http_connection to either upgrade or close (as normal)
-map $http_upgrade $connection_upgrade {
- default upgrade;
- '' close;
-}
-
-server {
- listen 80;
- listen [::]:80;
- server_name {{ liquid_truth_hostnames | join(' ') }};
-
- include snippets/acmetool.conf;
-
- location / {
- return 301 https://$host$request_uri;
- }
-}
-
-server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- server_name {{ liquid_truth_hostnames | join(' ') }};
-
- include snippets/acmetool.conf;
- include snippets/ssl.conf;
- ssl_certificate /var/lib/acme/live/{{ liquid_truth_hostnames[0] }}/fullchain;
- ssl_certificate_key /var/lib/acme/live/{{ liquid_truth_hostnames[0] }}/privkey;
- include snippets/hsts.conf;
-
- location / {
- proxy_buffering off;
- proxy_ignore_headers "X-Accel-Buffering";
- proxy_request_buffering off;
- proxy_http_version 1.1;
-
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
-
- # for websockets
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $connection_upgrade;
-
- proxy_pass http://127.0.0.1:8080;
- }
-}