changed config to use variables, added parameters
This commit is contained in:
@@ -32,7 +32,7 @@ class cd_nagios::certbot::config (
|
|||||||
# create cert
|
# create cert
|
||||||
|
|
||||||
exec { 'create_cert':
|
exec { 'create_cert':
|
||||||
command => template('cd_nagios/certbot/get_cert.erb'),
|
command => template($ng_get_cert_erb),
|
||||||
cwd => '/tmp',
|
cwd => '/tmp',
|
||||||
path => ['/bin','/usr/bin'],
|
path => ['/bin','/usr/bin'],
|
||||||
provider => 'shell',
|
provider => 'shell',
|
||||||
@@ -49,7 +49,7 @@ class cd_nagios::certbot::config (
|
|||||||
path => ['/bin','/usr/bin','/opt/'],
|
path => ['/bin','/usr/bin','/opt/'],
|
||||||
provider => 'shell',
|
provider => 'shell',
|
||||||
notify => Service['httpd'],
|
notify => Service['httpd'],
|
||||||
unless => template('cd_nagios/certbot/unless_renew_cert.erb'),
|
unless => template($ng_unless_renew_erb),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,7 +372,9 @@ $ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf'
|
|||||||
$ng_welcome_conf_erb = 'cd_nagios/httpd/welcome_conf.erb'
|
$ng_welcome_conf_erb = 'cd_nagios/httpd/welcome_conf.erb'
|
||||||
$ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf'
|
$ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf'
|
||||||
$ng_forward_conf_erb = 'cd_nagios/httpd/forward_conf.erb'
|
$ng_forward_conf_erb = 'cd_nagios/httpd/forward_conf.erb'
|
||||||
|
$ng_get_cert_erb = 'cd_nagios/certbot/get_cert.erb'
|
||||||
|
$ng_unless_get_cert = 'cd_nagios/certbot/unless_get_cert.erb'
|
||||||
|
$ng_unless_renew_erb = 'cd_nagios/certbot/unless_renew_cert.erb'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
|
|
||||||
|
|||||||
7
templates/certbot/unless_renew_cert.erb
Normal file
7
templates/certbot/unless_renew_cert.erb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
<% if @ng_enable_certbot == true %>
|
||||||
|
case `find /etc/letsencrypt/renewal -type f -name "<%= @ng_nagios_server %>.conf" -mtime +80` in
|
||||||
|
'') echo 'No filename found' exit 0 ;;
|
||||||
|
*) echo 'Found filename' exit 1 ;;
|
||||||
|
esac
|
||||||
|
<% end %>
|
||||||
Reference in New Issue
Block a user