File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
from fabric .api import *
2
+ from time import sleep
2
3
3
4
4
5
def puppet (* args ):
@@ -45,3 +46,15 @@ def lookup_hieradata(key):
45
46
config_file = '{0}/hiera.yml' .format (puppet_directory )
46
47
variables = '::environment=production ::lsbdistcodename=precise ::settings::manifestdir={0}/manifests' .format (puppet_directory )
47
48
run ('hiera --config {0} {1} {2}' .format (config_file , key , variables ))
49
+
50
+
51
+ @task
52
+ @hosts ('puppetmaster-1.management' )
53
+ def sign_certificates ():
54
+ """Sign Puppet certificates on the Puppetmaster when launching machines"""
55
+ print ('Signing certificates in a loop. Cancel this command to stop signing certificates.' )
56
+ while True :
57
+ # 24 is the exit code that Puppet returns when there are no waiting certificate requests to sign
58
+ with settings (ok_ret_codes = [0 , 24 ]):
59
+ sudo ('puppet cert sign --all' )
60
+ sleep (10 )
You can’t perform that action at this time.
0 commit comments