diff --git a/host_vars/ariane b/host_vars/ariane index 8081c3d..389ce7c 100644 --- a/host_vars/ariane +++ b/host_vars/ariane @@ -5,10 +5,12 @@ lxc: containers: - name: betam revision: "01" - hwaddr: 2e:6d:b6:07:14:01 template: debian - extra: lxc.cgroup.devices.allow = c 188:0 rwm + config: + - lxc.network.hwaddr = 2e:6d:b6:07:14:01 + - lxc.cgroup.devices.allow = c 188:0 rwm - name: zyklon revision: "01" - hwaddr: 2e:6d:b6:07:15:01 template: voidlinux + config: + - lxc.network.hwaddr = 2e:6d:b6:07:15:01 diff --git a/roles/ariane/tasks/lxc.yml b/roles/ariane/tasks/lxc.yml index 82ac740..59c3325 100644 --- a/roles/ariane/tasks/lxc.yml +++ b/roles/ariane/tasks/lxc.yml @@ -33,14 +33,5 @@ lxc_container: name: "lxc-{{ item.name }}-{{ item.revision }}" template: "{{ item.template }}" - with_items: "{{ lxc.containers }}" - -- name: lxc - config - template: - dest: "/var/lib/lxc/lxc-{{ item.name }}-{{ item.revision }}/config" - src: lxc.j2 - owner: root - group: root - mode: 0644 - backup: yes + container_config: "{{ item.config}}" with_items: "{{ lxc.containers }}" diff --git a/roles/ariane/templates/lxc.j2 b/roles/ariane/templates/lxc.j2 deleted file mode 100644 index c2660b1..0000000 --- a/roles/ariane/templates/lxc.j2 +++ /dev/null @@ -1,19 +0,0 @@ -# {{ ansible_managed }} - -lxc.network.type = veth -lxc.network.link = br0 -lxc.network.flags = up -lxc.network.hwaddr = {{ item.hwaddr }} - -lxc.aa_profile = unconfined -lxc.rootfs = /var/lib/lxc/lxc-{{ item.name }}-{{ item.revision }}/rootfs -lxc.rootfs.backend = dir - -lxc.include = /usr/share/lxc/config/{{ item.template }}.common.conf - -lxc.utsname = lxc-{{ item.name }}-{{ item.revision }} -lxc.arch = amd64 -{% if item.extra is defined %} - -{{ item.extra }} -{% endif %}