diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-07-11 00:02:40 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-07-11 00:05:20 -0400 |
commit | 4e9fb2d323dffc288a27d9cc918fc78de930ba5b (patch) | |
tree | 35d3227a210143ecaefda42cbf5796ed74397369 /modules/certbot/files/bootstrap-certbot | |
parent | dc5da84a004d6d5b2e045f0ca422747f514240ce (diff) | |
download | puppet-tozt-4e9fb2d323dffc288a27d9cc918fc78de930ba5b.tar.gz puppet-tozt-4e9fb2d323dffc288a27d9cc918fc78de930ba5b.zip |
improve certbot provisioning script
Diffstat (limited to 'modules/certbot/files/bootstrap-certbot')
-rwxr-xr-x | modules/certbot/files/bootstrap-certbot | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/modules/certbot/files/bootstrap-certbot b/modules/certbot/files/bootstrap-certbot deleted file mode 100755 index f0b43f4..0000000 --- a/modules/certbot/files/bootstrap-certbot +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env bash -set -eu -set -o pipefail - -config_dir="$1" -if systemctl is-active -q nginx; then - is_running=1 -else - is_running= -fi - -cleanup() { - if [ -z "$is_running" ]; then - systemctl stop nginx - fi - - if [ -e /etc/nginx/nginx.conf.backup ]; then - mv /etc/nginx/nginx.conf.backup /etc/nginx.conf - fi -} -trap cleanup EXIT - -mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup -cat > /etc/nginx/nginx.conf <<EOF -worker_processes 1; -events { - worker_connections 1024; -} -http { - server { - listen 80 default; - server_name tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name blog.tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name paste.tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name git.tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name rss.tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name munin.tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name metabase.tozt.net; - location / { - root /tmp; - } - } - server { - listen 80; - server_name rc-teleterm.tozt.net; - location / { - root /tmp; - } - } -} -EOF - -if [ -z "$is_running" ]; then - systemctl start nginx -fi - -if [ -z "$config_dir" ]; then - /usr/bin/certbot -n --agree-tos -m doy@tozt.net --nginx -d tozt.net -d blog.tozt.net -d paste.tozt.net -d git.tozt.net -d rss.tozt.net -d munin.tozt.net -d metabase.tozt.net -d rc-teleterm.tozt.net -d bitwarden.tozt.net -d gitea.tozt.net -d influxdb.tozt.net -d chronograf.tozt.net -else - /usr/bin/certbot -n --agree-tos -m doy@tozt.net --nginx -d tozt.net -d blog.tozt.net -d paste.tozt.net -d git.tozt.net -d rss.tozt.net -d munin.tozt.net -d metabase.tozt.net -d rc-teleterm.tozt.net -d bitwarden.tozt.net -d gitea.tozt.net -d influxdb.tozt.net -d chronograf.tozt.net --config-dir "$config_dir" -fi |