diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-10-19 23:15:14 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-10-19 23:15:14 -0400 |
commit | 8317b706d7a0a91c67c46950be07d40168705b6c (patch) | |
tree | 0dbba9df21c01deb1ed165fda1dce43dbdd8e2d5 /modules/certbot | |
parent | d0ef063b3d2cf7b4c2eba540a0773dae3afc26ef (diff) | |
download | puppet-tozt-8317b706d7a0a91c67c46950be07d40168705b6c.tar.gz puppet-tozt-8317b706d7a0a91c67c46950be07d40168705b6c.zip |
rename modules dir
Diffstat (limited to 'modules/certbot')
-rwxr-xr-x | modules/certbot/files/bootstrap-certbot | 69 | ||||
-rw-r--r-- | modules/certbot/files/reload-cert | 5 | ||||
-rw-r--r-- | modules/certbot/manifests/init.pp | 54 | ||||
-rw-r--r-- | modules/certbot/templates/certbot | 3 |
4 files changed, 0 insertions, 131 deletions
diff --git a/modules/certbot/files/bootstrap-certbot b/modules/certbot/files/bootstrap-certbot deleted file mode 100755 index 4cf3ea5..0000000 --- a/modules/certbot/files/bootstrap-certbot +++ /dev/null @@ -1,69 +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; - } - } -} -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 -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 --config-dir "$config_dir" -fi diff --git a/modules/certbot/files/reload-cert b/modules/certbot/files/reload-cert deleted file mode 100644 index 9ca23e5..0000000 --- a/modules/certbot/files/reload-cert +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -eu -set -o pipefail - -systemctl restart nginx diff --git a/modules/certbot/manifests/init.pp b/modules/certbot/manifests/init.pp deleted file mode 100644 index 27d59a6..0000000 --- a/modules/certbot/manifests/init.pp +++ /dev/null @@ -1,54 +0,0 @@ -class certbot($config_dir=undef) { - if $config_dir { - $_config_dir = $config_dir - } - else { - $_config_dir = "/etc/letsencrypt" - } - - include cron - include nginx - - package { - [ - 'certbot', - 'certbot-nginx', - ]: - ensure => installed; - } - - file { - '/etc/cron.daily/certbot': - content => template('certbot/certbot'), - mode => '0755', - require => [ - Package['certbot'], - Class['cron'], - ]; - "${_config_dir}/renewal-hooks": - ensure => directory, - require => Package['certbot']; - "${_config_dir}/renewal-hooks/deploy": - ensure => directory, - require => File["${_config_dir}/renewal-hooks"]; - "${_config_dir}/renewal-hooks/deploy/reload-cert": - source => 'puppet:///modules/certbot/reload-cert', - require => File["${_config_dir}/renewal-hooks/deploy"]; - "/usr/local/bin/bootstrap-certbot": - source => 'puppet:///modules/certbot/bootstrap-certbot', - mode => '0755'; - } - - exec { "initial certbot run": - provider => shell, - command => "/usr/local/bin/bootstrap-certbot ${config_dir}", - creates => "${_config_dir}/live", - require => [ - Package["certbot"], - # not Class["nginx"], because of circular dependencies with nginx::site - Package["nginx"], - Package["certbot-nginx"], - File['/usr/local/bin/bootstrap-certbot'], - ], - } -} diff --git a/modules/certbot/templates/certbot b/modules/certbot/templates/certbot deleted file mode 100644 index 9568fe1..0000000 --- a/modules/certbot/templates/certbot +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -certbot renew -q<%= @config_dir_opts %> |