From df6d4d206ecf96a646cc9da796b35481c90b9c63 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sat, 23 Dec 2023 16:33:36 +0100 Subject: [PATCH] fix: add file permissions --- tasks/create_unix_user.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tasks/create_unix_user.yml b/tasks/create_unix_user.yml index 92a8ee2..8ae4841 100644 --- a/tasks/create_unix_user.yml +++ b/tasks/create_unix_user.yml @@ -5,6 +5,8 @@ user_user_home: "{{ unix_user.value.home | default('/home/' + unix_user.key) }}" - name: "Create btrfs volume for unix user: {{ unix_user.key }}" + when: unix_user.value.btrfs is defined and + unix_user.value.btrfs block: - name: "Create btrfs volume for unix user: {{ unix_user.key }}" community.general.btrfs_subvolume: @@ -15,8 +17,7 @@ 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 + mode: "0755" - name: "Create unix user without additional groups and uid: {{ unix_user.key }}" ansible.builtin.user: @@ -71,6 +72,8 @@ when: unix_user.value.groups is defined and unix_user.value.uid is not defined - name: "Adapt permissions and copy skel for unix user: {{ unix_user.key }}" + when: unix_user.value.btrfs is defined and + unix_user.value.btrfs block: - name: "Copy skel dir" ansible.builtin.copy: @@ -79,14 +82,14 @@ remote_src: true owner: "{{ unix_user.key }}" group: "{{ unix_user.value.group | default('users') }}" + mode: "0644" - name: "Change permission unix users home dir: {{ unix_user.key }}" 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 + mode: "0755" - name: "Create .ssh directory for unix user: {{ unix_user.key }}" ansible.builtin.file: