diff --git a/playbooks/awx.yml b/playbooks/awx.yml new file mode 100644 index 00000000..a84f438d --- /dev/null +++ b/playbooks/awx.yml @@ -0,0 +1,31 @@ +--- +- hosts: localhost + gather_facts: no + collections: + - kubernetes.core + - operator_sdk.util + vars: + no_log: true + pre_tasks: + - name: Verify imagePullSecrets + k8s_info: + kind: Secret + namespace: '{{ ansible_operator_meta.namespace }}' + name: redhat-operators-pull-secret + register: _rh_ops_secret + no_log: "{{ no_log }}" + - name: Create imagePullSecret + k8s: + state: present + definition: + apiVersion: v1 + kind: Secret + metadata: + name: redhat-operators-pull-secret + namespace: '{{ ansible_operator_meta.namespace }}' + stringData: + operator: awx + when: + - (_rh_ops_secret is not defined) or not (_rh_ops_secret['resources'] | length) + roles: + - installer diff --git a/watches.yaml b/watches.yaml index 4cca48b7..10dd3275 100644 --- a/watches.yaml +++ b/watches.yaml @@ -3,7 +3,7 @@ - version: v1beta1 group: awx.ansible.com kind: AWX - role: installer + playbook: playbooks/awx.yml snakeCaseParameters: False - version: v1beta1