---
- name: Buildah put/fetch on missing container
  hosts: localhost
  gather_facts: false
  vars:
    ansible_connection: containers.podman.buildah
    ansible_host: ci-missing-buildah
  tasks:
    - name: Put should fail
      copy:
        content: abc
        dest: /root/a.txt
      register: r_put
      ignore_errors: true

    - name: Fetch should fail
      fetch:
        src: /etc/os-release
        dest: /tmp/osr
        flat: true
      register: r_fetch
      ignore_errors: true

    - assert:
        that:
          - r_put is failed
          - r_put.msg is search("Container .* not found")
          - r_fetch is failed
          - r_fetch.msg is search("Container .* not found")
