---

- name: automation-broker-operator
  hosts: localhost
  become: false
  gather_facts: false
  connection: local
  vars:
    state: present
    broker_name: "{{ meta.name }}"
    broker_namespace: "{{ meta.namespace }}"
    broker_image: "{{ lookup('env', 'IMAGE') }}"
  tasks:
    - name: Validation
      assert:
        that:
          - broker_name is defined
          - broker_namespace is defined
          - broker_image is defined
        msg: |
          broker_name broker_namespace broker_image must be defined
          The IMAGE environment variable must provide the broker's image name
          and should be specified in the operator's deployment specification.
    - name: Run automation-broker role
      include_role:
        name: automation-broker

---

- name: automation-broker-operator
  hosts: localhost
  become: false
  gather_facts: false
  connection: local
  vars:
    state: present
    broker_name: "{{ meta.name }}"
    broker_namespace: "{{ meta.namespace }}"
    broker_image: "{{ lookup('env', 'IMAGE') }}"
  tasks:
    - name: Validation
      assert:
        that:
          - broker_name
          - broker_namespace
          - broker_image
        msg: |
          broker_name broker_namespace broker_image must be defined
          The IMAGE environment variable must provide the broker's image name
          and should be specified in the operator's deployment specification.
    - name: Run automation-broker role
      include_role:
        name: automation-broker

Check for truthy since these values are always defined
Check for truthy since these values are always defined
