diff --git a/defaults/main.yml b/defaults/main.yml index 257af400..78847984 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -67,6 +67,16 @@ lxc_default_tasks_max: 8192 lxc_container_directory: "/var/lib/lxc" 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 # This should only be done for production use with a linux kernel > 3.14 # which is when overlayfs was merged into the mainline kernel diff --git a/tasks/lxc_post_install.yml b/tasks/lxc_post_install.yml index 5ef9b223..737d0249 100644 --- a/tasks/lxc_post_install.yml +++ b/tasks/lxc_post_install.yml @@ -34,6 +34,7 @@ - { 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.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" } tags: - lxc-files diff --git a/templates/lxc-openstack-common.conf.j2 b/templates/lxc-openstack-common.conf.j2 new file mode 100644 index 00000000..c969abaf --- /dev/null +++ b/templates/lxc-openstack-common.conf.j2 @@ -0,0 +1,7 @@ +# {{ ansible_managed }} + +{% for key, values in lxc_container_common_config.items() %} +{% for value in values %} +{{ key }} = {{ value }} +{% endfor %} +{% endfor %}