diff options
Diffstat (limited to 'cloudinit/CloudConfig/cc_puppet.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_puppet.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/cloudinit/CloudConfig/cc_puppet.py b/cloudinit/CloudConfig/cc_puppet.py index 9cfe7a49..b498c5f0 100644 --- a/cloudinit/CloudConfig/cc_puppet.py +++ b/cloudinit/CloudConfig/cc_puppet.py @@ -19,21 +19,15 @@ import os import pwd import socket import subprocess +import cloudinit.CloudConfig as cc def handle(name,cfg,cloud,log,args): # If there isn't a puppet key in the configuration don't do anything if not cfg.has_key('puppet'): return puppet_cfg = cfg['puppet'] # Start by installing the puppet package ... - e=os.environ.copy() - e['DEBIAN_FRONTEND']='noninteractive' - # Make sure that the apt database is updated since it's not run by - # default - # Note: we should have a helper to check if apt-get update - # has already been run on this instance to speed the boot time. - subprocess.check_call(['apt-get', 'update'], env=e) - subprocess.check_call(['apt-get', 'install', '--assume-yes', - 'puppet'], env=e) + cc.install_packages(("puppet",)) + # ... and then update the puppet configuration if puppet_cfg.has_key('conf'): # Add all sections from the conf object to puppet.conf |