From a3091080edc93fb291dd6ea577abdd99c387a96d Mon Sep 17 00:00:00 2001 From: jonnybravo Date: Tue, 3 Feb 2026 11:42:21 +0100 Subject: [PATCH] Fix: Exclude root user from tmux configuration Modified 'roles/tmux/tasks/main.yml' to ensure that the tmux configuration is not applied to the root user's home directory. This was achieved by adding a condition to exclude the 'root' user when generating the list of user home directories. --- roles/tmux/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/tmux/tasks/main.yml b/roles/tmux/tasks/main.yml index f8d2073..9beaef7 100644 --- a/roles/tmux/tasks/main.yml +++ b/roles/tmux/tasks/main.yml @@ -16,7 +16,9 @@ set_fact: user_home_dirs: "{{ user_home_dirs | default([]) + [item.value[4]] }}" loop: "{{ all_users.ansible_facts.getent_passwd | dict2items }}" - when: item.value[5] in ['/bin/bash', '/bin/zsh', '/usr/bin/bash', '/usr/bin/zsh', '/usr/bin/fish'] + when: + - item.value[5] in ['/bin/bash', '/bin/zsh', '/usr/bin/bash', '/usr/bin/zsh', '/usr/bin/fish'] + - item.value[0] != 'root' - name: Display the list of collected home directories ansible.builtin.debug: