From 22184b7ca3f78808d8025bab5981ed92f8ad99f5 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 17 Jun 2010 22:22:39 -0400 Subject: make cloud-config modules configurable by cloud-config The list of cloud-config modules is now kept in cloud config itself. There is a builtin list in cloudinit, which is overrideable by /etc/cloud/cloud.cfg or user data cloud-config. This should make the modules more easily added or removed (as no code needs to be edited now) Basic summary of changes: - move CloudConfig.py -> cloudinit/CloudConfig/__init__.py - split cloud-config modules into their own files named cloudinit/CloudConfig/cc_.py - remove all the upstart/cloud-config-* scripts, replacing them with upstart/cloud-config.conf --- cloudinit/CloudConfig/cc_disable_ec2_metadata.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 cloudinit/CloudConfig/cc_disable_ec2_metadata.py (limited to 'cloudinit/CloudConfig/cc_disable_ec2_metadata.py') diff --git a/cloudinit/CloudConfig/cc_disable_ec2_metadata.py b/cloudinit/CloudConfig/cc_disable_ec2_metadata.py new file mode 100644 index 00000000..a4b4280f --- /dev/null +++ b/cloudinit/CloudConfig/cc_disable_ec2_metadata.py @@ -0,0 +1,9 @@ +import cloudinit.util as util +from cloudinit.CloudConfig import per_always + +frequency = per_always + +def handle(name,cfg,cloud,log,args): + if util.get_cfg_option_bool(cfg, "disable_ec2_metadata", False): + fwall="route add -host 169.254.169.254 reject" + subprocess.call(fwall.split(' ')) -- cgit v1.2.3