From 4444142df97d209dba86c1ad75d45a2ed54e6433 Mon Sep 17 00:00:00 2001 From: Paul Herbosch Date: Thu, 19 Sep 2024 09:27:51 +0200 Subject: [PATCH 1/2] [NEWRELIC_INFRA] lookup license key by default --- manifests/newrelic_infra.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/newrelic_infra.pp b/manifests/newrelic_infra.pp index 27cb3369..6340e9e2 100644 --- a/manifests/newrelic_infra.pp +++ b/manifests/newrelic_infra.pp @@ -107,7 +107,7 @@ # Paul Herbosch # class profiles::newrelic_infra ( - String $license_key, + String $license_key = lookup('data::newrelic::license_key', Optional[String], 'first', undef), Boolean $manage_repo = false, Optional[Variant[Hash]] $logging = undef, Optional[Variant[Hash]] $integrations = undef, From c5aeaeb5a6bcac482ae21c28f535ae97bc8a8857 Mon Sep 17 00:00:00 2001 From: Paul Herbosch Date: Thu, 19 Sep 2024 13:40:57 +0200 Subject: [PATCH 2/2] Add environment label to all newrelic_infra nodes --- manifests/newrelic_infra.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/newrelic_infra.pp b/manifests/newrelic_infra.pp index 6340e9e2..6105fd6b 100644 --- a/manifests/newrelic_infra.pp +++ b/manifests/newrelic_infra.pp @@ -117,9 +117,12 @@ realize Apt::Source['newrelic-infra'] class { 'newrelic_infra::agent': - ensure => 'latest', - license_key => $license_key, - manage_repo => $manage_repo + ensure => 'latest', + license_key => $license_key, + manage_repo => $manage_repo, + custom_attributes => { + environment => "$::environment" + } } if $logging {