summaryrefslogtreecommitdiff
path: root/jails/datagubbe
diff options
context:
space:
mode:
Diffstat (limited to 'jails/datagubbe')
-rw-r--r--jails/datagubbe/nginx.conf.j251
-rw-r--r--jails/datagubbe/tasks.yaml52
2 files changed, 103 insertions, 0 deletions
diff --git a/jails/datagubbe/nginx.conf.j2 b/jails/datagubbe/nginx.conf.j2
new file mode 100644
index 0000000..d772466
--- /dev/null
+++ b/jails/datagubbe/nginx.conf.j2
@@ -0,0 +1,51 @@
+worker_processes 1;
+
+# This default error log path is compiled-in to make sure configuration parsing
+# errors are logged somewhere, especially during unattended boot when stderr
+# isn't normally logged anywhere. This path will be touched on every nginx
+# start regardless of error log location configured here. See
+# https://trac.nginx.org/nginx/ticket/147 for more info.
+#
+#error_log /var/log/nginx/error.log;
+#
+
+#pid logs/nginx.pid;
+
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ # '$status $body_bytes_sent "$http_referer" '
+ # '"$http_user_agent" "$http_x_forwarded_for"';
+
+ #access_log logs/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ #keepalive_timeout 0;
+ keepalive_timeout 65;
+
+ #gzip on;
+
+ server {
+ listen [::]:80;
+ server_name {{ server_name }};
+
+ #charset koi8-r;
+
+ #access_log logs/host.access.log main;
+
+ location / {
+ root {{ root }};
+ index index.html index.htm;
+ }
+ }
+}
diff --git a/jails/datagubbe/tasks.yaml b/jails/datagubbe/tasks.yaml
new file mode 100644
index 0000000..b10889c
--- /dev/null
+++ b/jails/datagubbe/tasks.yaml
@@ -0,0 +1,52 @@
+- name: create webroot
+ jexec:
+ cmd: mkdir -p /var/www/html
+ jail: "{{ jail.name }}"
+
+- name: create index file
+ ansible.builtin.copy:
+ content: |
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Welcome to datagubbe.dev</title>
+ <style type="text/css">
+ body {
+ background-color: #222;
+ color: #ccc;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Datagubbe</h1>
+ </body>
+ </html>
+ dest: "{{ jailbase }}/{{ jail.name }}/var/www/html/index.html"
+
+- name: install nginx
+ community.general.pkgng:
+ name:
+ - nginx
+ state: latest
+ jail: "{{ jail.name }}"
+
+- name: create nginx config
+ ansible.builtin.template:
+ src: nginx.conf.j2
+ dest: "{{ jailbase }}/{{ jail.name }}/usr/local/etc/nginx/nginx.conf"
+ vars:
+ root: "/var/www/html"
+ server_name: "datagubbe.dev"
+
+- name: enable nginx
+ community.general.sysrc:
+ name: nginx_enable
+ value: "YES"
+ jail: "{{ jail.name }}"
+
+- name: start nginx
+ jexec:
+ cmd: service nginx status || service nginx start
+ jail: "{{ jail.name }}"
+