Modification lxc pour buster, car lxc 3

This commit is contained in:
Eric Morino 2019-10-01 15:37:04 +02:00
parent d625d840a9
commit 00d1daeccb
4 changed files with 10 additions and 9 deletions

View File

@ -96,9 +96,9 @@
when: name == 'php73'
- name: Configure mailname
lineinfile:
template:
src: mailname.j2
dest: "/var/lib/lxc/{{name}}/rootfs/etc/mailname"
line: "{{ansible_fqdn}}"
notify: "Restart opensmtpd"
when: name == 'php73'

View File

@ -3,7 +3,7 @@
lxc_unprivilegied_containers: false
# Network type to use. See lxc.container.conf(5).
lxc_network_type: "none"
lxc_net_0_type: "none"
# Partition to bind mount into containers.
lxc_mount_part: "/home"

View File

@ -5,7 +5,7 @@
register: container_exists
- name: Create container
command: "lxc-create --name {{name}} --template debian --bdev dir --logfile /var/log/lxc/lxc-{{name}}.log --logpriority INFO -- --arch amd64 --release {{release}}"
command: "lxc-create --name {{name}} --template download --bdev dir --logfile /var/log/lxc/lxc-{{name}}.log --logpriority INFO -- --dist debian --release {{release}} --arch amd64"
when: container_exists.stdout_lines == []
#- name: Create container
@ -13,22 +13,23 @@
# name: "{{name}}"
# container_log: true
# template: download
# state: stopped
# state: started
# template_options: "--release {{release}}"
# when: container_exists.stdout_lines == []
- name: Disable network configuration inside container
replace:
name: "/var/lib/lxc/{{name}}/rootfs/etc/default/networking"
regexp: "^#CONFIGURE_INTERFACES=yes"
replace: CONFIGURE_INTERFACES=no
when: lxc_network_type == "none"
when: lxc_net_0_type == "none"
- name: Disable interface shut down on halt inside container
lineinfile:
name: "/var/lib/lxc/{{name}}/rootfs/etc/default/halt"
line: "NETDOWN=no"
when:
- lxc_network_type == "none"
- lxc_net_0_type == "none"
- release != "stretch"
- release != "buster"

View File

@ -7,7 +7,7 @@ lxc.id_map = g 0 100000 10000
{% endif %}
# Set the default network virtualization method.
lxc.network.type = {{lxc_network_type}}
lxc.net.0.type = {{lxc_net_0_type}}
{% if lxc_mount_part %}
# Mount {{lxc_mount_part}} into containers.
@ -16,7 +16,7 @@ lxc.mount.entry = {{lxc_mount_part}} {{lxc_mount_part |replace('/', '')}} none b
{% endif %}
# Only one tty is enough.
# This require that you disabled others tty ([2-6]) in systemd.
lxc.tty = 1
lxc.tty.max = 1
# Run 64bits containers
lxc.arch = x86_64