From 1d1916ed299dee145cda5d8169a9e57173c1f461 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 15 Dec 2023 22:46:31 +0100 Subject: [PATCH] fix: adjust btrfs subvol permissions --- tasks/create_unix_user.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tasks/create_unix_user.yml b/tasks/create_unix_user.yml index 0ac51b5..92a8ee2 100644 --- a/tasks/create_unix_user.yml +++ b/tasks/create_unix_user.yml @@ -5,8 +5,16 @@ user_user_home: "{{ unix_user.value.home | default('/home/' + unix_user.key) }}" - name: "Create btrfs volume for unix user: {{ unix_user.key }}" - community.general.btrfs_subvolume: - name: "{{ user_user_home }}" + block: + - name: "Create btrfs volume for unix user: {{ unix_user.key }}" + community.general.btrfs_subvolume: + name: "{{ user_user_home }}" + - name: "Adapt home dir permissions" + ansible.builtin.file: + path: "{{ user_user_home }}" + owner: "{{ unix_user.key }}" + group: "{{ unix_user.value.group | default('users') }}" + state: directory when: unix_user.value.btrfs is defined and unix_user.value.btrfs