From 523464cbfbd0bb5746ebb44e5de588d53b924d09 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Sat, 21 Feb 2026 14:21:14 +0100 Subject: [PATCH] OP#436 add main file control link to wiki --- manifests/params.pp | 56 ++++++++++++------------- templates/certbot/get_cert.erb | 1 - templates/certbot/unless_get_cert.erb | 4 -- templates/certbot/unless_renew_cert.erb | 7 ---- templates/nagios/nagios_cfg.erb | 10 ++--- 5 files changed, 33 insertions(+), 45 deletions(-) delete mode 100644 templates/certbot/get_cert.erb delete mode 100644 templates/certbot/unless_get_cert.erb delete mode 100644 templates/certbot/unless_renew_cert.erb diff --git a/manifests/params.pp b/manifests/params.pp index 1e16048..c3603e3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -78,34 +78,6 @@ class confdroid_nagios::params ( $ng_nagios_cfg_file = "${ng_main_dir}/nagios.cfg" $ng_nagios_cfg_erb = 'confdroid_nagios/nagios/nagios_cfg.erb' -## old - $ng_main_config = "${ng_main_dir}/nagios.cfg" - $ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg" - $ng_cgi_cfg_erb = 'confdroid_nagios/nagios/cgi_cfg.erb' - $ng_htpasswd_file = "${ng_main_dir}/passwd" - $ng_htpasswd_head = 'confdroid_nagios/nagios/htpasswd_head.erb' - $ng_htpasswd_rule = 'confdroid_nagios/nagios/htpasswd_rule.erb' - $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb' - $ng_statcgi_erb = 'confdroid_nagios/selinux/statuscgi.erb' - $ng_statdat_erb = 'confdroid_nagios/selinux/statusdat.erb' - $ng_checknrpe_erb = 'confdroid_nagios/selinux/checknrpe.erb' - $ng_checknagios_erb = 'confdroid_nagios/selinux/checknagios.erb' - $ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf' - $ng_nagios_conf_erb = 'confdroid_nagios/httpd/nagios_conf.erb' - $ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf' - $ng_welcome_conf_erb = 'confdroid_nagios/httpd/welcome_conf.erb' - $ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf' - $ng_forward_conf_erb = 'confdroid_nagios/httpd/forward_conf.erb' - $ng_get_cert_erb = 'confdroid_nagios/certbot/get_cert.erb' - $ng_unless_get_cert = 'confdroid_nagios/certbot/unless_get_cert.erb' - $ng_unless_renew_erb = 'confdroid_nagios/certbot/unless_renew_cert.erb' - $ng_index_html_file = '/var/www/html/index.html' - $ng_index_html_erb = 'confdroid_nagios/httpd/index_html.erb' - $ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf' - $ng_ssl_vhost_erb = 'confdroid_nagios/httpd/nagios_ssl_vhost.erb' - $ng_resource_erb = 'confdroid_nagios/nagios/resource_cfg.erb' - $ng_grep_erb = 'confdroid_nagios/selinux/grep.erb' - # nagios $ng_target_templates = "${ng_conf_d_dir}/nagios_templates.cfg" $ng_templates_head_erb = 'confdroid_nagios/nagios/templates_cfg_head.erb' @@ -139,6 +111,34 @@ class confdroid_nagios::params ( $ng_target_command = "${ng_conf_d_dir}/nagios_commands_base.cfg" $ng_nagios_service_cmd = 'check_nagios!/var/log/nagios/status.dat!5!/usr/sbin/nagios' +## old + $ng_main_config = "${ng_main_dir}/nagios.cfg" + $ng_cgi_cfg_file = "${ng_main_dir}/cgi.cfg" + $ng_cgi_cfg_erb = 'confdroid_nagios/nagios/cgi_cfg.erb' + $ng_htpasswd_file = "${ng_main_dir}/passwd" + $ng_htpasswd_head = 'confdroid_nagios/nagios/htpasswd_head.erb' + $ng_htpasswd_rule = 'confdroid_nagios/nagios/htpasswd_rule.erb' + $ng_taccgi_erb = 'confdroid_nagios/selinux/taccgi.erb' + $ng_statcgi_erb = 'confdroid_nagios/selinux/statuscgi.erb' + $ng_statdat_erb = 'confdroid_nagios/selinux/statusdat.erb' + $ng_checknrpe_erb = 'confdroid_nagios/selinux/checknrpe.erb' + $ng_checknagios_erb = 'confdroid_nagios/selinux/checknagios.erb' + $ng_nagios_conf = '/etc/httpd/conf.d/nagios.conf' + $ng_nagios_conf_erb = 'confdroid_nagios/httpd/nagios_conf.erb' + $ng_welcome_conf = '/etc/httpd/conf.d/welcome.conf' + $ng_welcome_conf_erb = 'confdroid_nagios/httpd/welcome_conf.erb' + $ng_forward_conf = '/etc/httpd/conf.d/nagios_forward.conf' + $ng_forward_conf_erb = 'confdroid_nagios/httpd/forward_conf.erb' + $ng_get_cert_erb = 'confdroid_nagios/certbot/get_cert.erb' + $ng_unless_get_cert = 'confdroid_nagios/certbot/unless_get_cert.erb' + $ng_unless_renew_erb = 'confdroid_nagios/certbot/unless_renew_cert.erb' + $ng_index_html_file = '/var/www/html/index.html' + $ng_index_html_erb = 'confdroid_nagios/httpd/index_html.erb' + $ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf' + $ng_ssl_vhost_erb = 'confdroid_nagios/httpd/nagios_ssl_vhost.erb' + $ng_resource_erb = 'confdroid_nagios/nagios/resource_cfg.erb' + $ng_grep_erb = 'confdroid_nagios/selinux/grep.erb' + # includes must be last include confdroid_nagios::main::config } diff --git a/templates/certbot/get_cert.erb b/templates/certbot/get_cert.erb deleted file mode 100644 index 1936aa4..0000000 --- a/templates/certbot/get_cert.erb +++ /dev/null @@ -1 +0,0 @@ -certbot certonly -t -n --agree-tos --webroot -w <%= @ng_certbot_webroot %>/ -d <%= @ng_webserver_name %> --email <%= @ng_mail_user %> diff --git a/templates/certbot/unless_get_cert.erb b/templates/certbot/unless_get_cert.erb deleted file mode 100644 index bc8ce29..0000000 --- a/templates/certbot/unless_get_cert.erb +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -<% if @ng_enable_certbot == true %> -test -d /etc/letsencrypt/archive/<%= @ng_nagios_server %> -<% end %> diff --git a/templates/certbot/unless_renew_cert.erb b/templates/certbot/unless_renew_cert.erb deleted file mode 100644 index 6ebb22d..0000000 --- a/templates/certbot/unless_renew_cert.erb +++ /dev/null @@ -1,7 +0,0 @@ -#!/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 %> diff --git a/templates/nagios/nagios_cfg.erb b/templates/nagios/nagios_cfg.erb index 1885266..67607b6 100644 --- a/templates/nagios/nagios_cfg.erb +++ b/templates/nagios/nagios_cfg.erb @@ -9,13 +9,13 @@ log_file=<%= @ng_log_file %> # OBJECT CONFIGURATION FILE(S) -# These are the object configuration files in which you define hosts, -# host groups, contacts, contact groups, services, etc. -# You can split your object definitions across several config files -# if you wish (as shown below), or keep them all in a single config file. +# This section has been outsourced into <%= @ng_conf_d_dir %>/*.cfg files, +# because the commands are now built via PuppetDB exports and imports. +# Original files are available at https://3for.me/hn6ca (membership area) +# or at nagios.org # You can specify individual object config files as shown below: -cfg_file=/etc/nagios/objects/commands.cfg +cfg_file=<%= @ng_target_command %> cfg_file=/etc/nagios/objects/contacts.cfg cfg_file=/etc/nagios/objects/timeperiods.cfg cfg_file=/etc/nagios/objects/templates.cfg