Introduce common conf profile extension

With moving from distro-specific profiles, which are not packaged
for EL, to a common profile, we want to extend it with some parameters
which were defined by default in Debian/Ubuntu profiles.

There is no distinguishing between distros right now, as these
parameters should be still valid for EL as well.

According to the README file, /usr/share/lxc/config/common.conf.d/
directory is intended to extend the common.conf profile, which
we are using now with a custom common configuration.

It does not mean or replace any other possible custom configuration
for LXC containers we have in lxc-container-create role, but rather
intends to compensate lost parameters which were used inderectly
by loading OS-specific profiles, rather then a common one.

Change-Id: I53965eb0c978884d8a26c8300b123f23dc433e57
This commit is contained in:
Dmitriy Rabotyagov
2025-05-29 11:39:22 +02:00
parent 73c9581299
commit 35e738bc86
3 changed files with 18 additions and 0 deletions

View File

@@ -67,6 +67,16 @@ lxc_default_tasks_max: 8192
lxc_container_directory: "/var/lib/lxc" lxc_container_directory: "/var/lib/lxc"
lxc_container_cache_path: "/var/cache/lxc/download" lxc_container_cache_path: "/var/cache/lxc/download"
lxc_container_common_config:
lxc.mount.entry:
- /sys/kernel/debug sys/kernel/debug none bind,optional 0 0
- /sys/kernel/security sys/kernel/security none bind,optional 0 0
- /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
- mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0
lxc.cgroup.devices.allow:
- c 254:0 rm # rtc
- c 10:228 rwm # hpet
# The container backing store can be set to 'overlayfs' to use overlayfs # The container backing store can be set to 'overlayfs' to use overlayfs
# This should only be done for production use with a linux kernel > 3.14 # This should only be done for production use with a linux kernel > 3.14
# which is when overlayfs was merged into the mainline kernel # which is when overlayfs was merged into the mainline kernel

View File

@@ -34,6 +34,7 @@
- { src: lxc-openstack.conf.j2, dest: "/etc/lxc/lxc-openstack.conf" } - { src: lxc-openstack.conf.j2, dest: "/etc/lxc/lxc-openstack.conf" }
- { src: lxc-net.default.j2, dest: "{{ system_config_dir }}/lxc-net", mode: "0644" } - { src: lxc-net.default.j2, dest: "{{ system_config_dir }}/lxc-net", mode: "0644" }
- { src: lxc.default.j2, dest: "{{ system_config_dir }}/lxc", mode: "0644" } - { src: lxc.default.j2, dest: "{{ system_config_dir }}/lxc", mode: "0644" }
- { src: lxc-openstack-common.conf.j2, dest: "/usr/share/lxc/config/common.conf.d/80-openstack-common.conf" }
- { src: lxc-system-manage.j2, dest: "/usr/local/bin/lxc-system-manage", mode: "0755" } - { src: lxc-system-manage.j2, dest: "/usr/local/bin/lxc-system-manage", mode: "0755" }
tags: tags:
- lxc-files - lxc-files

View File

@@ -0,0 +1,7 @@
# {{ ansible_managed }}
{% for key, values in lxc_container_common_config.items() %}
{% for value in values %}
{{ key }} = {{ value }}
{% endfor %}
{% endfor %}