summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2012-01-28 11:12:53 -0500
committerTodd Zullinger <tmz@pobox.com>2012-01-28 11:27:24 -0500
commite7a6988fdd8e1fea1e2994f04d84909ec92576dd (patch)
tree1d9f067a92e89877b6907372e47492dbc5262faf
parent04382cd4ac75238432fa38b534463e27adb946f3 (diff)
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.
-rw-r--r--puppethost.py2
-rw-r--r--template.spec4
2 files changed, 5 insertions, 1 deletions
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 <tmz@pobox.com>
- Replace %%define with %%global
+- Use %%{puppetuser} for ownership of %%{ssldir}
* Thu Nov 20 2008 Todd Zullinger <tmz@pobox.com>
- Initial template for puppet host package