--- - name: Check for presence of Deployment k8s_info: api_version: apps/v1 kind: Deployment name: "{{ ansible_operator_meta.name }}" namespace: "{{ ansible_operator_meta.namespace }}" register: tower_deployment # Just execute deployment steps when auto_upgrade is true or when no deployment exists - name: Start installation include_tasks: install.yml when: (tower_deployment['resources'] | length > 0 and auto_upgrade | bool ) or (tower_deployment['resources'] | length == 0)