From a5b29398fca3e1da792f885c39653287ac05cd56 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 9 Mar 2021 14:50:53 -0800 Subject: [PATCH] puppet: Only install ksplice uptrack if there is an access key. --- puppet/zulip_ops/manifests/ksplice_uptrack.pp | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/puppet/zulip_ops/manifests/ksplice_uptrack.pp b/puppet/zulip_ops/manifests/ksplice_uptrack.pp index 96bf0eba27..672f3ea84e 100644 --- a/puppet/zulip_ops/manifests/ksplice_uptrack.pp +++ b/puppet/zulip_ops/manifests/ksplice_uptrack.pp @@ -1,27 +1,29 @@ class zulip_ops::ksplice_uptrack { - file { '/etc/uptrack': - ensure => 'directory', - owner => 'root', - group => 'adm', - mode => '0750', - } $ksplice_access_key = zulipsecret('secrets', 'ksplice_access_key', '') - file { '/etc/uptrack/uptrack.conf': - ensure => file, - owner => 'root', - group => 'adm', - mode => '0640', - content => template('zulip_ops/uptrack/uptrack.conf.erb'), - } - $setup_apt_repo_file = "${::zulip_scripts_path}/lib/setup-apt-repo-ksplice" - exec{ 'setup-apt-repo-ksplice': - command => $setup_apt_repo_file, - unless => "${setup_apt_repo_file} --verify", - } - Package { 'uptrack': - require => [ - Exec['setup-apt-repo-ksplice'], - File['/etc/uptrack/uptrack.conf'], - ], + if $ksplice_access_key != '' { + file { '/etc/uptrack': + ensure => 'directory', + owner => 'root', + group => 'adm', + mode => '0750', + } + file { '/etc/uptrack/uptrack.conf': + ensure => file, + owner => 'root', + group => 'adm', + mode => '0640', + content => template('zulip_ops/uptrack/uptrack.conf.erb'), + } + $setup_apt_repo_file = "${::zulip_scripts_path}/lib/setup-apt-repo-ksplice" + exec{ 'setup-apt-repo-ksplice': + command => $setup_apt_repo_file, + unless => "${setup_apt_repo_file} --verify", + } + Package { 'uptrack': + require => [ + Exec['setup-apt-repo-ksplice'], + File['/etc/uptrack/uptrack.conf'], + ], + } } }