Skip to content

Commit

Permalink
remove bogus output of ansible remediation for dir_perms_world_writab…
Browse files Browse the repository at this point in the history
…le_root_owned
  • Loading branch information
vojtapolasek committed Jan 29, 2021
1 parent 1803988 commit 4b50ad4
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@
recurse: yes
register: found_dirs

- name: "Create list of world writable directories"
set_fact:
world_writable_dirs: "{{ found_dirs.files | selectattr('woth') | list }}"

- name: "debug"
debug:
msg: "{{ world_writable_dirs }}"

- name: "Change owner to root on directories which are world writable"
file:
path: '{{ item.path }}'
owner: root
loop: '{{ found_dirs.files }}'
when: item.woth
loop: '{{ world_writable_dirs }}'
ignore_errors: yes

0 comments on commit 4b50ad4

Please sign in to comment.