- name: recursive chmod example command: | chmod -c -R ug=rw,o=r,a-x+X "{{item}}" register: chmod_status changed_when: chmod_status.stdout != "" with_items: - "/home/user/sample/dir"