From e390d91c05a1a3906ae67e1ff1276ccf9b6e2de8 Mon Sep 17 00:00:00 2001 From: Jonh Wendell Date: Sun, 14 Jun 2015 17:32:50 -0300 Subject: [PATCH] Ec2: Add the variable "install_init_scripts" To control whether ec2 init scripts should be installed on the image. Defaults to true, to keep current behaviour. --- bootstrapvz/providers/ec2/README.rst | 3 ++- bootstrapvz/providers/ec2/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrapvz/providers/ec2/README.rst b/bootstrapvz/providers/ec2/README.rst index 184f236..348ebd2 100644 --- a/bootstrapvz/providers/ec2/README.rst +++ b/bootstrapvz/providers/ec2/README.rst @@ -11,7 +11,8 @@ Unless `the cloud-init plugin <../../plugins/cloud_init>`__ is used, special startup scripts will be installed that automatically fetch the configured authorized\_key from the instance metadata and save or run any userdata supplied (if the userdata begins with ``#!`` it will be -run). +run). Set the variable ``install_init_scripts`` to ``False`` in order +to disable this behaviour. Credentials ----------- diff --git a/bootstrapvz/providers/ec2/__init__.py b/bootstrapvz/providers/ec2/__init__.py index b368c8a..b3f2287 100644 --- a/bootstrapvz/providers/ec2/__init__.py +++ b/bootstrapvz/providers/ec2/__init__.py @@ -68,12 +68,14 @@ def resolve_tasks(taskset, manifest): tasks.network.EnableDHCPCDDNS, initd.AddExpandRoot, initd.RemoveHWClock, - tasks.initd.AddEC2InitScripts, initd.InstallInitScripts, tasks.ami.RegisterAMI, ]) + if manifest.provider.get('install_init_scripts', True): + taskset.add(tasks.initd.AddEC2InitScripts) + if manifest.volume['partitions']['type'] != 'none': taskset.add(initd.AdjustExpandRootScript)