From 8b8c041240456e0bf8ef7d55241477e2f15f161a Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 17 Mar 2017 10:54:17 +0000 Subject: [PATCH 1/3] remove the include ::apt Having the `include ::apt` in this module then prevents someone from defining their own instance of the apt class with custom parameters, forcing the use of hiera to configure the apt class. --- manifests/repo.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/repo.pp b/manifests/repo.pp index aa5211ded..daac6c2e5 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -80,7 +80,6 @@ } 'Debian' : { - include ::apt if ($::architecture == 'armv6l') { apt::source { 'zabbix': location => 'http://naizvoru.com/raspbian/zabbix', From 97347a458e5fe0cc2d207bd7ad21fe806e285093 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Mon, 20 Mar 2017 10:19:32 +0000 Subject: [PATCH 2/3] make the removal of include ::apt optional --- manifests/params.pp | 1 + manifests/repo.pp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index ae9b3b8d4..79e21cb50 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,6 +18,7 @@ $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' + $manage_apt = true $manage_repo = true $zabbix_package_agent = 'zabbix-agent' $agent_configfile_path = '/etc/zabbix/zabbix_agentd.conf' diff --git a/manifests/repo.pp b/manifests/repo.pp index daac6c2e5..673ed6947 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -27,6 +27,7 @@ # class zabbix::repo ( $manage_repo = $zabbix::params::manage_repo, + $manage_apt = $zabbix::params::manage_apt, $repo_location = $zabbix::params::repo_location, $zabbix_version = $zabbix::params::zabbix_version, ) inherits zabbix::params { @@ -80,6 +81,10 @@ } 'Debian' : { + if ($manage_apt) { + include ::apt + } + if ($::architecture == 'armv6l') { apt::source { 'zabbix': location => 'http://naizvoru.com/raspbian/zabbix', From c7d50c11b759f0bbe15012c2aabfd67892d50a55 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Mon, 20 Mar 2017 12:55:52 +0000 Subject: [PATCH 3/3] need to make $manage_apt available for all OSes --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 79e21cb50..29b44d44d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,7 +18,6 @@ $server_fping6location = '/usr/bin/fping6' $proxy_fpinglocation = '/usr/bin/fping' $proxy_fping6location = '/usr/bin/fping6' - $manage_apt = true $manage_repo = true $zabbix_package_agent = 'zabbix-agent' $agent_configfile_path = '/etc/zabbix/zabbix_agentd.conf' @@ -69,6 +68,7 @@ $manage_service = true $default_vhost = false $manage_firewall = false + $manage_apt = true $repo_location = '' $manage_resources = false $manage_vhost = true