kangasta/pullnrun

View on GitHub
examples/when.yml

Summary

Maintainability
Test Coverage
name: When demo
stop_on_errors: no
tags:
- example
tasks:
- name: Failing task
  run_command:
    command:
    - "{{pullnrun_python_executable }}"
    - -c
    - exit(1)
  register: fail_result
- name: Successful task
  echo:
    message: Hello
  register: success_result
  when: not fail_result.success
- name: When with name
  echo:
    message: asd
  when: fail_result.success
- echo:
    message: asd
  when: "not success_result.success"
- name: When with undefined var
  echo:
    message: asd
  when: undefined_var == 3