51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
---
|
|
- name: lxc - install lxc
|
|
package: name=lxc
|
|
|
|
- name: lxc - install libpam-cgfs
|
|
package: name=libpam-cgfs
|
|
|
|
- name: lxc - install bridge-utils
|
|
package: name=bridge-utils
|
|
|
|
- name: lxc - install python-lxc
|
|
package: name=python-lxc
|
|
|
|
- name: lxc - /etc/default/lxc-net
|
|
copy:
|
|
dest: /etc/default/lxc-net
|
|
content: 'USE_LXC_BRIDGE="true"'
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
backup: yes
|
|
|
|
- name: lxc - /etc/lxc/default.conf
|
|
copy:
|
|
dest: /etc/lxc/default.conf
|
|
src: lxc_default.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
backup: yes
|
|
|
|
- name: lxc - create container
|
|
lxc_container:
|
|
name: "lxc-{{ item.name }}-{{ item.revision }}"
|
|
template: "{{ item.template }}"
|
|
container_config: "{{ item.config }}"
|
|
with_items: "{{ lxc.containers }}"
|
|
|
|
- name : lxc - enable ssh on voidlinux
|
|
lxc_container:
|
|
name: "lxc-{{ item.name }}-{{ item.revision }}"
|
|
container_command: "ln -s /etc/sv/{sshd,dhcpcd-eth0} /var/service/"
|
|
when: item.template == "voidlinux"
|
|
changed_when: False
|
|
with_items: "{{ lxc.containers }}"
|
|
|
|
- name: lxc - create .ssh directory for root in VM
|
|
file: path="/var/lib/lxc/lxc-{{ item.name }}-{{ item.revision }}/rootfs/root/.ssh" state=directory owner=root group=root mode=0700
|
|
with_items: "{{ lxc.containers }}"
|
|
notify: lxc - inital ssh authorized_keys
|