diff --git a/ansible/build-and-push.yml b/ansible/build-and-push.yml new file mode 100644 index 00000000..4cdcb1d7 --- /dev/null +++ b/ansible/build-and-push.yml @@ -0,0 +1,17 @@ +--- +- name: Build and Deploy the AWX Operator + hosts: localhost + + collections: + - community.general + + tasks: + - name: Build and (optionally) push operator image + docker_image: + name: "{{ operator_image }}:{{ operator_version }}" + pull: no + push: "{{ push_image | bool }}" + build: + dockerfile: "build/Dockerfile" + path: "../" + force: yes diff --git a/ansible/deploy-operator.yml b/ansible/deploy-operator.yml new file mode 100644 index 00000000..c7fdc045 --- /dev/null +++ b/ansible/deploy-operator.yml @@ -0,0 +1,29 @@ +--- +- name: Reconstruct awx-operator.yaml + include: chain-operator-files.yml + +- name: Deploy Operator + hosts: localhost + vars: + k8s_namespace: "default" + obliterate: no + + collections: + - community.kubernetes + + tasks: + - name: Obliterate Operator + k8s: + state: absent + namespace: "{{ k8s_namespace }}" + src: "../deploy/awx-operator.yaml" + wait: yes + when: obliterate | bool + + - name: Deploy Operator + k8s: + state: present + namespace: "{{ k8s_namespace }}" + apply: yes + wait: yes + src: "../deploy/awx-operator.yaml"