From e7a6988fdd8e1fea1e2994f04d84909ec92576dd Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Sat, 28 Jan 2012 11:12:53 -0500 Subject: Set ownership on ssldir to puppet This is adjustable via the config with the puppetuser setting. When puppet runs, it resets the ownership of these files, which causes rpm -V to show them as modified. --- puppethost.py | 2 ++ template.spec | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/puppethost.py b/puppethost.py index 8d00af0..2e6176a 100644 --- a/puppethost.py +++ b/puppethost.py @@ -40,6 +40,7 @@ defaults = { 'ssldir': '/etc/puppet/ssl', 'template': '%(ssldir)s/template.spec', 'pkgprefix': 'host-package-', + 'puppetuser': 'puppet', 'verbose': 1, } @@ -197,6 +198,7 @@ class PuppetHost(object): text = text.replace('__RELEASE__', self.opts['release']) text = text.replace('__SSLDIR__', self.opts['destssldir']) text = text.replace('__PKGPREFIX__', self.opts['pkgprefix']) + text = text.replace('__PUPPETUSER__', self.opts['puppetuser']) specfp = open(spec, 'w') specfp.write(text) diff --git a/template.spec b/template.spec index 9421cb5..25408d2 100644 --- a/template.spec +++ b/template.spec @@ -3,6 +3,7 @@ %global release __RELEASE__ %global ssldir __SSLDIR__ %global pkgprefix __PKGPREFIX__ +%global puppetuser __PUPPETUSER__ Name: %{pkgprefix}%{hostname} Version: %{version} @@ -45,13 +46,14 @@ rm -rf %{buildroot} %files -%defattr(-,root,root,-) +%defattr(-,%{puppetuser},root,-) %{ssldir} %changelog * Sat Jan 28 2012 Todd Zullinger - Replace %%define with %%global +- Use %%{puppetuser} for ownership of %%{ssldir} * Thu Nov 20 2008 Todd Zullinger - Initial template for puppet host package -- cgit