From 37335960a0c48470a1e7fc8a8fd0c1d83f2de52d Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 24 May 2018 10:35:58 -0700 Subject: [PATCH] puppet: Stop automatically creating hiera.yaml on newer distros. This fixes some unnecessary warnings on systems running Ubuntu bionic. --- scripts/zulip-puppet-apply | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/zulip-puppet-apply b/scripts/zulip-puppet-apply index ed0433ea92..541f704446 100755 --- a/scripts/zulip-puppet-apply +++ b/scripts/zulip-puppet-apply @@ -17,8 +17,10 @@ config = configparser.RawConfigParser() config.read("/etc/zulip/zulip.conf") if not os.path.exists("/etc/puppet/hiera.yaml"): - # Suppress warnings about hiera.yaml not existing. - subprocess.check_call(["touch", "/etc/puppet/hiera.yaml"]) + codename = subprocess.check_output(["lsb_release", "-cs"]).strip().decode("utf-8") + if codename in ["trusty", "stretch", "xenial"]: + # Suppress warnings in old puppet about hiera.yaml not existing. + subprocess.check_call(["touch", "/etc/puppet/hiera.yaml"]) puppet_config = """ Exec { path => "/usr/sbin:/usr/bin:/sbin:/bin" }