itamae/cookbooks/grafana-front/ssl.rb

17 lines
652 B
Ruby

[
'rm -f /etc/nginx/sites-enabled/*',
'ln -f -s /etc/nginx/sites-available/maintenance /etc/nginx/sites-enabled/maintenance',
'systemctl reload nginx',
"test -e /etc/letsencrypt/live/#{node['grafana']['FQDN']}/cert.pem || certbot certonly --webroot -d #{node['grafana']['FQDN']} --webroot-path /usr/share/nginx/html/ --email simoom634@yahoo.co.jp --agree-tos -n",
'/home/webadm/bin/nginx-config.sh',
].each do |cmd|
execute cmd
end
remote_file "/etc/letsencrypt/live/#{node['grafana']['FQDN']}/dhparams_4096.pem" do
owner 'root'
group 'root'
end
execute "openssl rand 48 > /etc/letsencrypt/live/#{node['grafana']['FQDN']}/ticket.key"