Skip to content

Commit

Permalink
Merge pull request #11951 from makinacorpus/lxc
Browse files Browse the repository at this point in the history
cloud.lxc: autostart support
  • Loading branch information
techhat committed Apr 13, 2014
2 parents ff02cbd + 0cdfbc7 commit d8d1c2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions salt/cloud/clouds/lxc.py
Expand Up @@ -384,6 +384,11 @@ def create(vm_, call=None):
netmask = vm_.get('netmask', '24')
bridge = vm_.get('bridge', 'lxcbr0')
gateway = vm_.get('gateway', 'auto')
autostart = vm_.get('autostart', True)
if autostart:
autostart = "1"
else:
autostart = "0"
size = vm_.get('size', '10G')
ssh_username = vm_.get('ssh_username', 'user')
sudo = vm_.get('sudo', True)
Expand Down Expand Up @@ -453,6 +458,7 @@ def create(vm_, call=None):
lxc_conf.append({'lxc.network.ipv4.gateway': gateway})
if bridge is not None:
lxc_conf.append({'lxc.network.link': bridge})
lxc_conf.append({'lxc.start.auto': autostart})
changes['100_creation'] = ''
created = False
cret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
Expand Down

0 comments on commit d8d1c2b

Please sign in to comment.