Index: cloud-init-fedora/cloudinit/CloudConfig/cc_puppet.py =================================================================== --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_puppet.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_puppet.py @@ -22,6 +22,7 @@ import subprocess import StringIO import ConfigParser import cloudinit.CloudConfig as cc +import cloudinit.util as util def handle(name,cfg,cloud,log,args): # If there isn't a puppet key in the configuration don't do anything @@ -58,6 +59,7 @@ def handle(name,cfg,cloud,log,args): ca_fh.close() os.chown('/var/lib/puppet/ssl/certs/ca.pem', pwd.getpwnam('puppet').pw_uid, 0) + util.restorecon_if_possible('/var/lib/puppet', recursive=True) else: #puppet_conf_fh.write("\n[%s]\n" % (cfg_name)) # If puppet.conf already has this section we don't want to write it again @@ -81,6 +83,7 @@ def handle(name,cfg,cloud,log,args): os.rename('/etc/puppet/puppet.conf','/etc/puppet/puppet.conf.old') with open('/etc/puppet/puppet.conf', 'wb') as configfile: puppet_config.write(configfile) + util.restorecon_if_possible('/etc/puppet/puppet.conf') # Set puppet default file to automatically start subprocess.check_call(['sed', '-i', '-e', 's/^START=.*/START=yes/', Index: cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py =================================================================== --- cloud-init-fedora.orig/cloudinit/CloudConfig/cc_ssh.py +++ cloud-init-fedora/cloudinit/CloudConfig/cc_ssh.py @@ -66,6 +66,8 @@ def handle(name,cfg,cloud,log,args): genkeys+='ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -t ecdsa -N ""; ' subprocess.call(('sh', '-c', "{ %s }