From d93f2fd63d9869cfe3d7688efb122f4d71a391fc Mon Sep 17 00:00:00 2001 From: Russell Whelan Date: Thu, 10 Aug 2017 13:38:31 +0100 Subject: [PATCH 1/2] Add support to make the APM repo configuration optional --- manifests/params.pp | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 6a06fe0..a20da7e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,28 +19,34 @@ $newrelic_php_package = 'newrelic-php5' $newrelic_php_service = 'newrelic-daemon' $newrelic_php_conf_dir = ['/etc/php.d'] - package { 'newrelic-repo-5-3.noarch': - ensure => present, - source => 'http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm', - provider => rpm, - } + $newrelic_enable_repo = 'true' + if $newrelic_enable_repo { + package { 'newrelic-repo-5-3.noarch': + ensure => present, + source => 'http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm', + provider => rpm, + } + } } 'Debian': { $newrelic_package_name = 'newrelic-sysmond' $newrelic_service_name = 'newrelic-sysmond' $newrelic_php_package = 'newrelic-php5' $newrelic_php_service = 'newrelic-daemon' - apt::source { 'newrelic': - location => 'http://apt.newrelic.com/debian/', - repos => 'non-free', - key => { - id => 'B60A3EC9BC013B9C23790EC8B31B29E5548C16BF', - key => 'https://download.newrelic.com/548C16BF.gpg', - }, - include => { - src => false, - }, - release => 'newrelic', + $newrelic_enable_repo = 'true' + if $newrelic_enable_repo { + apt::source { 'newrelic': + location => 'http://apt.newrelic.com/debian/', + repos => 'non-free', + key => { + id => 'B60A3EC9BC013B9C23790EC8B31B29E5548C16BF', + key => 'https://download.newrelic.com/548C16BF.gpg', + }, + include => { + src => false, + }, + release => 'newrelic', + } } case $facts['operatingsystem'] { 'Debian': { From 7efdd7fd8300644036cabbeecee3e206e5159a6c Mon Sep 17 00:00:00 2001 From: Russell Whelan Date: Fri, 11 Aug 2017 11:05:49 +0100 Subject: [PATCH 2/2] Convert bools from tring to true bools --- manifests/params.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index a20da7e..a21b663 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,7 +19,7 @@ $newrelic_php_package = 'newrelic-php5' $newrelic_php_service = 'newrelic-daemon' $newrelic_php_conf_dir = ['/etc/php.d'] - $newrelic_enable_repo = 'true' + $newrelic_enable_repo = true if $newrelic_enable_repo { package { 'newrelic-repo-5-3.noarch': ensure => present, @@ -33,7 +33,7 @@ $newrelic_service_name = 'newrelic-sysmond' $newrelic_php_package = 'newrelic-php5' $newrelic_php_service = 'newrelic-daemon' - $newrelic_enable_repo = 'true' + $newrelic_enable_repo = true if $newrelic_enable_repo { apt::source { 'newrelic': location => 'http://apt.newrelic.com/debian/',