28 lines
468 B
Ruby

#
# Cookbook Name:: kosmos-base
# Recipe:: letsencrypt
#
# Copyright 2018, Kosmos
#
# All rights reserved - Do Not Redistribute
#
# Install certbot and set up hooks
apt_repository "certbot" do
uri "ppa:certbot/certbot"
end
package "certbot"
file "/etc/letsencrypt/renewal-hooks/post/nginx" do
content <<-EOF
#!/usr/bin/env bash
# Reloading nginx is enough to read the new certificates
systemctl reload nginx
EOF
mode 0755
owner "root"
group "root"
end