puppet: Stop automatically creating hiera.yaml on newer distros.

This fixes some unnecessary warnings on systems running Ubuntu bionic.
This commit is contained in:
Tim Abbott 2018-05-24 10:35:58 -07:00
parent 42da4522a9
commit 37335960a0
1 changed files with 4 additions and 2 deletions

View File

@ -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" }