Skip to content

Commit

Permalink
fix: comment Set chattr -R -a
Browse files Browse the repository at this point in the history
  • Loading branch information
victorely committed Jul 26, 2024
1 parent d29a59b commit 082f5cc
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,15 @@
name: root
password: "!"

- name: Set chattr -R -a on users' files and directories
command: "chattr -R -a /home/{{ item }}"
loop: "{{ basic_to_remove_users }}"
when:
- basic_to_remove_users is defined
- basic_to_remove_users | length > 0
- stat_result.stat.exists
vars:
ansible_become: yes
register: stat_result
tasks:
- name: Check if user home directory exists
stat:
path: "/home/{{ item }}"
register: stat_result
loop: "{{ basic_to_remove_users }}"
when:
- basic_to_remove_users is defined
- basic_to_remove_users | length > 0
#- name: Set chattr -R -a on users' files and directories TODO fix me
# command: "chattr -R -a /home/{{ item }}"
# loop: "{{ basic_to_remove_users }}"
# when:
# - basic_to_remove_users is defined
# - basic_to_remove_users | length > 0
# - ansible.builtin.stat(path="/home/{{ item }}").stat.exists
# vars:
# ansible_become: yes

- name: Remove old users
user:
Expand Down

0 comments on commit 082f5cc

Please sign in to comment.