Automate some build and release related activities

This commit is contained in:
Shane McDonald
2020-10-03 14:03:56 -04:00
parent 6f52a0121d
commit 48c8f07877
10 changed files with 92 additions and 51 deletions

View File

@@ -1,44 +0,0 @@
---
# To run: `ansible-playbook chain-operator-files.yml`
- name: Chain operator files together for easy deployment.
hosts: localhost
connection: local
gather_facts: false
vars:
operator_image: ansible/awx-operator:0.5.0
pull_policy: Always
operator_file_path: "../deploy/awx-operator.yaml"
operator_template: "../deploy/operator.yaml"
tasks:
- name: Clear out current contents of awx-operator.yml
copy:
dest: "{{ operator_file_path }}"
content: ''
force: true
- name: Concatenate operator files into awx-operator.yml
blockinfile:
path: "{{ operator_file_path }}"
block: "{{ item }}"
marker: ""
marker_begin: ""
marker_end: ""
insertafter: "EOF"
with_file:
- "../deploy/role.yaml"
- "../deploy/role_binding.yaml"
- "../deploy/service_account.yaml"
- "../deploy/operator.yaml"
- "../deploy/crds/awx_v1beta1_crd.yaml"
- name: Remove space at beginning of awx-operator.yml
shell: >
echo "$(tail -n +2 {{ operator_file_path }})" > {{ operator_file_path }}
changed_when: true
- name: Template the awx-operator.yaml file into awx-operator.yml
template:
src: "{{ operator_file_path }}"
dest: "{{ operator_file_path }}"