2014-03-23 23:12:07 +01:00
|
|
|
from bootstrapvz.base import Task
|
|
|
|
from bootstrapvz.common import phases
|
|
|
|
from bootstrapvz.common.tasks import initd
|
2013-12-29 23:21:50 +01:00
|
|
|
from . import assets
|
2013-07-07 14:58:03 +02:00
|
|
|
import os.path
|
|
|
|
|
|
|
|
|
2013-08-10 16:51:42 +02:00
|
|
|
class AddEC2InitScripts(Task):
|
|
|
|
description = 'Adding EC2 startup scripts'
|
2013-07-07 14:58:03 +02:00
|
|
|
phase = phases.system_modification
|
2013-11-21 15:54:42 +01:00
|
|
|
successors = [initd.InstallInitScripts]
|
2013-07-07 14:58:03 +02:00
|
|
|
|
2014-01-05 15:57:11 +01:00
|
|
|
@classmethod
|
|
|
|
def run(cls, info):
|
2013-07-07 14:58:03 +02:00
|
|
|
init_scripts = {'ec2-get-credentials': 'ec2-get-credentials',
|
2013-08-10 16:51:42 +02:00
|
|
|
'ec2-run-user-data': 'ec2-run-user-data'}
|
2013-07-07 14:58:03 +02:00
|
|
|
|
2013-12-29 23:21:50 +01:00
|
|
|
init_scripts_dir = os.path.join(assets, 'init.d')
|
2013-07-07 14:58:03 +02:00
|
|
|
for name, path in init_scripts.iteritems():
|
2013-08-10 16:51:42 +02:00
|
|
|
info.initd['install'][name] = os.path.join(init_scripts_dir, path)
|