---
- name: Create the test.example.com/v1alpha1.Collection
  k8s:
    state: present
    namespace: '{{ namespace }}'
    definition:
      apiVersion: test.example.com/v1alpha1
      kind: Collection
      metadata:
        name: collection-test
    wait: yes
    wait_timeout: 300
    wait_condition:
      type: Running
      reason: Successful
      status: "True"

- name: Assert ConfigMap has been created by collection Role
  assert:
    that: cm.data.did_it_work == 'indeed'
  vars:
    cm: "{{ q('k8s', api_version='v1', kind='ConfigMap', namespace=namespace, resource_name='test-this-collection').0 }}"
