Add playbooks for building and deploying operator

This commit is contained in:
Shane McDonald
2020-10-03 14:09:39 -04:00
parent 48c8f07877
commit 182d7a3ad5
2 changed files with 46 additions and 0 deletions

View File

@@ -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

View File

@@ -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"