up
This commit is contained in:
parent
c34df881ae
commit
337054426a
2 changed files with 9 additions and 3 deletions
|
@ -17,7 +17,6 @@ for task in tasks['results']:
|
|||
if task['task'] == 'container_create':
|
||||
# TODO: update task status to 1
|
||||
nodeclient.task_status_update(task['id'], 1)
|
||||
print task['id']
|
||||
|
||||
container_id = task['plain']['container_id']
|
||||
ipv4 = dict()
|
||||
|
@ -39,6 +38,10 @@ for task in tasks['results']:
|
|||
node.__container_authkey_create(container_id, task['plain']['ssh_key'])
|
||||
param_auth_key = '--auth-key /var/lib/gocloud/node/auth-keys/%s.pub' % container_id
|
||||
|
||||
param_packages = ''
|
||||
if template == 'ubuntu':
|
||||
param_packages = '--packages %s' % ','.join(config.packages['ubuntu'])
|
||||
|
||||
# create container
|
||||
lxc.lxc().create(
|
||||
container_id,
|
||||
|
@ -48,7 +51,8 @@ for task in tasks['results']:
|
|||
"%s --user %s --password %s" % (
|
||||
param_auth_key,
|
||||
task['plain']['username'],
|
||||
task['plain']['password']
|
||||
task['plain']['password'],
|
||||
param_packages
|
||||
)
|
||||
)
|
||||
lxc.lxc().start(container_id)
|
||||
|
@ -83,5 +87,4 @@ for task in tasks['results']:
|
|||
nodeclient.task_status_update(task['id'], 1)
|
||||
container_id = task['plain']['container_id']
|
||||
lxc.lxc().destroy(container_id)
|
||||
|
||||
nodeclient.task_status_update(task['id'], 2)
|
||||
|
|
|
@ -2,3 +2,6 @@ server = 'localhost:5000'
|
|||
node_id = "f411b7d6-bf93-4fcd-91ee-03e5343d0187"
|
||||
node_secret = "b3c9a8b0-95ca-11e5-bec1-28d244e159e9"
|
||||
interface = 'br0:0'
|
||||
packages = {
|
||||
'ubuntu': ['fail2ban']
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue