From 279ee1929aa7a1869eb31f6db32eab8194b2525c Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Wed, 9 Sep 2026 14:24:26 +0200 Subject: [PATCH] fix(tasks): create the bashrc before sourcing a drop-in from it The lineinfile task appends the source line to `~/.bashrc` but never declared `create`, so it aborted with "Destination does not exist" whenever that file was missing. This hits every user configured with `create_home: false`, and it hit every btrfs user as well, because their home is an empty subvolume and useradd therefore skips the skel rollout. `mode` is added along with it, otherwise a newly created bashrc would inherit whatever the umask happens to be. The existing `owner` and `group` were dead settings until now, since the file was never created by this task. Co-authored-by: Copilot --- tasks/create_shell_rc_file.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/create_shell_rc_file.yaml b/tasks/create_shell_rc_file.yaml index 18be3f3..2588f05 100644 --- a/tasks/create_shell_rc_file.yaml +++ b/tasks/create_shell_rc_file.yaml @@ -25,6 +25,8 @@ ansible.builtin.lineinfile: path: "{{ _unix_users_home }}/.bashrc" line: "source \"{{ _shell_rc_file }}\"" + create: true owner: "{{ unix_user.key }}" group: "{{ unix_user.value.group | default('users') }}" + mode: "0644" state: "present"