Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'this' from proposals#74 #30957

Closed
wants to merge 1 commit into from
Closed

Commits on Apr 9, 2019

  1. Implement 'this' from proposal 74

    As discussed in ansible/proposals#74 it is very convenient to be able to access the task result directly from `changed_when`, `failed_when` and `until`.
    
    For this we reserve the keyword 'this'.
    
    Examples:
    
    ```yaml
      # Wait until file exists
      - stat:
          path: /tmp/some.file
        until: this.stat.exists
    
      # Fail task when both files are identical
      - raw: diff foo/file1 bar/file2
        failed_when: this.rc == 0
    
      # Report a change when rc is not 2
      - shell: /usr/bin/billybass --mode="take me to the river"
        changed_when: this.rc != 2
    ```
    dagwieers committed Apr 9, 2019
    Configuration menu
    Copy the full SHA
    4ebaae0 View commit details
    Browse the repository at this point in the history