From 3fef36594a309dc94ca6325aebacae31e38c7aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 14 Jul 2021 01:01:35 +0200 Subject: Configure gandalf root webserver. --- manifests/site.pp | 2 ++ modules/profiles/manifests/gandalf_web.pp | 38 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 modules/profiles/manifests/gandalf_web.pp diff --git a/manifests/site.pp b/manifests/site.pp index d4dcce9..19a431d 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -4,6 +4,8 @@ node 'gandalf.adrift.space' { } include ::profiles::workstation + + include ::profiles::gandalf_web } node 'hornquist.se' { diff --git a/modules/profiles/manifests/gandalf_web.pp b/modules/profiles/manifests/gandalf_web.pp new file mode 100644 index 0000000..7aabf2c --- /dev/null +++ b/modules/profiles/manifests/gandalf_web.pp @@ -0,0 +1,38 @@ +class profiles::gandalf_web { + + class { '::nginx': + manage_repo => false, + # server_purge => true, + package_name => 'nginx', + service_config_check => true, + } + + $certname = 'bookmark.gandalf.adrift.space' + + + nginx::resource::server { 'gandalf': + ipv6_enable => true, + listen_options => 'default_server', + ipv6_listen_options => 'default_server', + server_name => [ '_' ], + access_log => absent, + error_log => absent, + ssl => true, + ssl_cert => "/etc/letsencrypt/live/${certname}/fullchain.pem", + ssl_key => "/etc/letsencrypt/live/${certname}/privkey.pem", + ssl_redirect => true, + index_files => [ 'index.html', ], + www_root => '/var/www/adrift.space', + use_default_location => false, + } + + nginx::resource::location { '/': + try_files => ['$uri', '$uri/', '=404'], + index_files => [], + ssl => true, + ssl_only => true, + autoindex => on, + server => 'gandalf', + } + +} -- cgit v1.2.3