diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-02-07 14:43:40 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-02-07 14:43:40 -0500 |
commit | 00ac0cfe971b1891b722455615df2230b0382567 (patch) | |
tree | a4c086b4692ae05194702a6563a761d1eff3e0cb /cloudinit/CloudConfig/cc_puppet.py | |
parent | e2045d8c68d0e7086487f3a02b9512e6f2581009 (diff) | |
download | vyos-cloud-init-00ac0cfe971b1891b722455615df2230b0382567.tar.gz vyos-cloud-init-00ac0cfe971b1891b722455615df2230b0382567.zip |
add apt helper routeins to CloudConfig, and use them in apt and puppet
Adding the apt helper routines to CloudConfig.
Then, make use of the following from cc_puppet and cc_apt_update_upgrade
update_package_sources():
install_packages(pkglist):
I'm not really terribly happy with this location for them. Their presence
here is really only because of apt-update's use of
'run-once-per-instance'.
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 |