Last active
June 14, 2016 19:44
-
-
Save arubdesu/8cd7e5bae7c190ccedac82f0092439aa to your computer and use it in GitHub Desktop.
Revisions
-
arubdesu revised this gist
Jun 14, 2016 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ #!/usr/bin/python """bootstraps puppet, which gets munki ready for SSL, and runs the munki function that shoves puppet's CA into the sys keychain. Assumes this is at /Library/MMCSupport/bootstrap_puppet.py, and called by outset(github.com/chilcote/outset)'s boot-every option""" import os import shutil @@ -27,7 +29,7 @@ def main(): print "\nPuppet bootstrap should be complete, seeding certs" # Uses munkilib's keychain module to inject into system keychain using puppet-set prefs keychain.add_ca_certs_to_system_keychain() shutil.move(sys.argv[0], '/Library/MMCSupport/bootstrap_puppet.py') sys.exit(code) if __name__ == '__main__': -
arubdesu created this gist
Jun 14, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/usr/bin/python """bootstraps puppet, which gets munki ready for SSL, and runs the munki function that shoves puppet's CA into the sys keychain""" import os import shutil import subprocess import sys import time sys.path.append('/usr/local/munki/munkilib') import keychain def main(): """gimme some main""" print "Starting puppet bootstrap process\n" munkipath = '/Users/Shared/.com.googlecode.munki.checkandinstallatstartup' puppet_cmd = ['/opt/puppetlabs/bin/puppet', 'agent', '-t'] while True: if os.path.exists(munkipath): print 'Sleeping another 15...' time.sleep(15) else: break print "Enough sleep, running puppet bootstrap" code = subprocess.check_call(puppet_cmd) print "\nPuppet bootstrap should be complete, seeding certs" # Uses munkilib's keychain module to inject into system keychain using puppet-set prefs keychain.add_ca_certs_to_system_keychain() shutil.move(sys.argv[0], '/Library/MMCSupport/bootstrap_puppet.py' sys.exit(code) if __name__ == '__main__': main()