- name: integration/runner/custom_binary_producing_json.yml
  hosts: test-targets
  any_errors_fatal: true
  gather_facts: true
  tasks:
    - block:
      - custom_binary_producing_json_Darwin:
          foo: true
        with_sequence: start=1 end={{end|default(1)}}
        register: out_darwin
      - set_fact: out={{out_darwin}}
      when: ansible_system == "Darwin"

    - block:
      - custom_binary_producing_json_Linux:
          foo: true
        with_sequence: start=1 end={{end|default(1)}}
        register: out_linux
      - set_fact: out={{out_linux}}
      when: ansible_system == "Linux"

    - assert:
        that: |
          out.changed and
          out.results[0].changed and
          out.results[0].msg == 'Hello, world.'
