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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user