Ansible conditional statements not evaluating correctly
问题 I have an ansible playbook with a couple of tasks that check a directory for files created on todays date and saves them in files . I'm doing my comparison off of files|length and print out two different messages depending if the length is 0 or not. Here is the code: - name: Grabbing all of the files that were created today shell: find /home/user/empty_directory -maxdepth 1 -daystart -ctime 0 -print register: files - debug: var=files.stdout - debug: msg="The directory isn't empty" when: files