Simplify lxc usage
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }}"
|
||||
|
||||
@@ -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 %}
|
||||
Reference in New Issue
Block a user