Subject: [ansible-devel] How to Stop playbook execution based on a file ?


Hi,
I basically wanted to skip the remaining of the playbook if a file exists
    - name: Check if the file exists
      stat:
        path: /home/ansible/dbname/sql/file.sql
      register: optional_file

    - debug:
        msg: "File Exists"
      when: optional_file.stat.exists == True

Also, Is there a way I read the same file, and based on a string I stop the
remaining playbook?

--