Browse Source

Various LXC fixes.

services
Slash 8 years ago
parent
commit
7017a8deeb
4 changed files with 8 additions and 5 deletions
  1. +4
    -1
      group_vars/all.yaml.example
  2. +2
    -2
      roles/lxc_guest/tasks/main.yaml
  3. +1
    -1
      roles/lxc_guest/templates/config.j2
  4. +1
    -1
      templates/interfaces.j2

+ 4
- 1
group_vars/all.yaml.example View File

@ -1,2 +1,5 @@
---
# The name (as defined in the inventory) of the external gateway.
ext_gateway: ""
# Put here the public key of the users CA.
user_ca_key: ""
ext_gateway:

+ 2
- 2
roles/lxc_guest/tasks/main.yaml View File

@ -37,5 +37,5 @@
name: "{{ vm_name }}"
state: "{{ container_state }}"
when: "lxc_existance.stdout == 'true'"
#- name: "waiting for ssh on {{ vm_name }} vm to start"
# wait_for: host="{{ hostvars[vm_name]['ansible_host'] }}" port=22 timeout=20
- name: "waiting for ssh on {{ vm_name }} vm to start"
wait_for: host="{{ hostvars[vm_name]['ansible_host'] }}" port=22 timeout=20

+ 1
- 1
roles/lxc_guest/templates/config.j2 View File

@ -11,5 +11,5 @@ lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.ipv4 = {{ hostvars[vm_name]['ansible_host'] }}/24
lxc.network.ipv4.gateway = {{ ext_gateway }}
lxc.network.ipv4.gateway = {{ hostvars[ext_gateway]['ansible_host'] }}
lxc.start.auto = {% if auto_start %}1{% else %}0{% endif %}

+ 1
- 1
templates/interfaces.j2 View File

@ -12,6 +12,6 @@ auto br0
iface br0 inet static
address {{ ansible_default_ipv4.address }}
netmask 255.255.255.0
gateway {{ ext_gateway }}
gateway {{ hostvars[ext_gateway]['ansible_host'] }}
bridge_ports eth0
bridge_fd 1

Loading…
Cancel
Save