Fix: Add defensive checks to prevent tmux configuration for invalid users

- Modified 'roles/tmux/tasks/main.yml' to explicitly filter out
  the root directory ('/') as a valid home directory.
- Modified 'roles/tmux/tasks/tmux_config.yml' by adding a conditional
  check () to all tasks. This prevents the
  tasks from running for users with invalid home directories, which
  resolves the 'chown failed' error.
This commit is contained in:
2026-02-03 11:49:23 +01:00
parent 871c7a9f7e
commit 1213254df3
2 changed files with 7 additions and 1 deletions

View File

@@ -20,7 +20,7 @@
- item.value[5] in ['/bin/bash', '/bin/zsh', '/usr/bin/bash', '/usr/bin/zsh', '/usr/bin/fish']
- item.value[0] != 'root'
- item.value[4] is defined
- item.value[4] | length > 1
- item.value[4] != '/'
- name: Display the list of collected home directories
ansible.builtin.debug: