From 26f9d171a404b3d7dfcd9ea69b9df3a78c22284d Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Mon, 26 Sep 2022 23:46:29 +0200 Subject: [PATCH] lxc-solr: detect the real partition options --- CHANGELOG.md | 2 ++ lxc/tasks/main.yml | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71f7be80..50ad3561 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ The **patch** part changes is incremented if multiple releases happen the same m ### Changed +* lxc-solr: detect the real partition options + ### Fixed ### Removed diff --git a/lxc/tasks/main.yml b/lxc/tasks/main.yml index 70f5dc2b..3ec586bd 100644 --- a/lxc/tasks/main.yml +++ b/lxc/tasks/main.yml @@ -43,11 +43,19 @@ - lxc_unprivilegied_containers | bool - root_subuids.rc != 0 -- name: Check if /var has not mount options or nosuid or nodev or noexec - shell: findmnt | grep -E "/var[^/]" | grep -e nodev -e noexec -e nosuid - register: check_var +- name: Get filesystem options + command: findmnt --noheadings --target /var/lib/lxc --output OPTIONS changed_when: false - failed_when: "check_var.rc == 0" + check_mode: no + register: check_fs_options + +- name: Check if options are correct + assert: + that: + - "'nodev' not in check_fs_options.stdout" + - "'noexec' not in check_fs_options.stdout" + - "'nosuid' not in check_fs_options.stdout" + msg: "LXC directory is in a filesystem with incompatible options" - name: Create containers include: create-container.yml