From 637f57f81f4f74644f5f8a38697c5e7d4473312c Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 1 Dec 2023 21:52:56 +0100 Subject: [PATCH] fix: create XDG base directories --- tasks/create_unix_user.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tasks/create_unix_user.yml b/tasks/create_unix_user.yml index 0032511..0ac51b5 100644 --- a/tasks/create_unix_user.yml +++ b/tasks/create_unix_user.yml @@ -163,3 +163,16 @@ path: "{{ user_user_home }}/.forward" state: absent when: unix_user.value.email is not defined + +- name: "Create XDG base directories" + ansible.builtin.file: + path: "{{ item }}" + owner: "{{ unix_user.key }}" + group: "{{ unix_user.value.group | default('users') }}" + mode: "0755" + state: "directory" + with_items: + - "{{ unix_user.value.xdg.dirs.cache | default(user_user_home + '/.cache') }}" + - "{{ unix_user.value.xdg.dirs.config | default(user_user_home + '/.config') }}" + - "{{ unix_user.value.xdg.dirs.data | default(user_user_home + '/.local/share') }}" + - "{{ unix_user.value.xdg.dirs.state | default(user_user_home + '/.local/state') }}"