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.
This commit is contained in:
Jonh Wendell 2015-06-14 17:32:50 -03:00
parent b8b94c1fc7
commit e390d91c05
2 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,8 @@ Unless `the cloud-init plugin <../../plugins/cloud_init>`__
is used, special startup scripts will be installed that automatically fetch the is used, special startup scripts will be installed that automatically fetch the
configured authorized\_key from the instance metadata and save or run configured authorized\_key from the instance metadata and save or run
any userdata supplied (if the userdata begins with ``#!`` it will be 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 Credentials
----------- -----------

View file

@ -68,12 +68,14 @@ def resolve_tasks(taskset, manifest):
tasks.network.EnableDHCPCDDNS, tasks.network.EnableDHCPCDDNS,
initd.AddExpandRoot, initd.AddExpandRoot,
initd.RemoveHWClock, initd.RemoveHWClock,
tasks.initd.AddEC2InitScripts,
initd.InstallInitScripts, initd.InstallInitScripts,
tasks.ami.RegisterAMI, tasks.ami.RegisterAMI,
]) ])
if manifest.provider.get('install_init_scripts', True):
taskset.add(tasks.initd.AddEC2InitScripts)
if manifest.volume['partitions']['type'] != 'none': if manifest.volume['partitions']['type'] != 'none':
taskset.add(initd.AdjustExpandRootScript) taskset.add(initd.AdjustExpandRootScript)