Andrew Bogott has submitted this change and it was merged.

Change subject: Clean up old certs with 'puppet cert clean'
......................................................................


Clean up old certs with 'puppet cert clean'

Previously we did an 'rm' which was sometimes incomplete
and depended on puppet version.

Change-Id: Icb506cb98f80cd0edbbf4a5415627aebca3fc7a6
---
M modules/puppetmaster/files/puppetsigner.py
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/puppetmaster/files/puppetsigner.py 
b/modules/puppetmaster/files/puppetsigner.py
index e65ab81..5163c6c 100755
--- a/modules/puppetmaster/files/puppetsigner.py
+++ b/modules/puppetmaster/files/puppetsigner.py
@@ -61,9 +61,8 @@
         query = "(&(objectclass=puppetclient)(|(dc=" + hostname + 
")(cnamerecord=" + hostname + ")(associateddomain=" + hostname + ")))"
         host_info = ds.search_s(basedn, ldap.SCOPE_SUBTREE, query)
         if not host_info:
-            signed_key_path = getPuppetInfo('ssldir') + '/ca/signed/' + 
hostname + '.pem'
             sys.stderr.write('Removing stale cert %s' % hostname)
-            os.remove(signed_key_path)
+            subprocess.check_call(['/usr/bin/puppet', 'cert', 'clean', 
hostname])
         elif not signed:
             sys.stderr.write('Signing new cert %s' % hostname)
             subprocess.check_call(['/usr/bin/puppet', 'cert', 'sign', 
hostname])

-- 
To view, visit https://gerrit.wikimedia.org/r/208638
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb506cb98f80cd0edbbf4a5415627aebca3fc7a6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to