---
- name: Create the test.example.com/v1alpha1.Inventory
  k8s:
    state: present
    namespace: '{{ namespace }}'
    definition: '{{ custom_resource }}'
    wait: yes
    wait_timeout: 300
    wait_condition:
      type: Running
      reason: Successful
      status: "True"
  vars:
    custom_resource: "{{ lookup('template', '/'.join([deploy_dir, 'crds/test.example.com_v1alpha1_inventory_cr.yaml'])) | from_yaml }}"

- name: Assert sentinel ConfigMap has been created for Molecule Test
  assert:
    that: cm.data.sentinel == 'test'
  vars:
    cm: "{{ q('k8s', api_version='v1', kind='ConfigMap', namespace=namespace, resource_name='inventory-cm').0 }}"
