-
Notifications
You must be signed in to change notification settings - Fork 594
/
chain-operator-files.yml
44 lines (39 loc) 路 1.32 KB
/
chain-operator-files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
# 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/tower-operator:0.4.0
pull_policy: Always
operator_file_path: "../deploy/tower-operator.yaml"
operator_template: "../deploy/operator.yaml"
tasks:
- name: Clear out current contents of tower-operator.yml
copy:
dest: "{{ operator_file_path }}"
content: ''
force: true
- name: Concatenate operator files into tower-operator.yml
blockinfile:
path: "{{ operator_file_path }}"
block: "{{ item }}"
marker: ""
marker_begin: ""
marker_end: ""
insertafter: "EOF"
with_file:
- "../deploy/crds/tower_v1beta1_tower_crd.yaml"
- "../deploy/role.yaml"
- "../deploy/role_binding.yaml"
- "../deploy/service_account.yaml"
- "../deploy/operator.yaml"
- name: Remove space at beginning of tower-operator.yml
shell: >
echo "$(tail -n +2 {{ operator_file_path }})" > {{ operator_file_path }}
changed_when: true
- name: Template the tower-operator.yaml file into tower-operator.yml
template:
src: "{{ operator_file_path }}"
dest: "{{ operator_file_path }}"