-
Notifications
You must be signed in to change notification settings - Fork 12
/
bootstrap.yaml
54 lines (44 loc) · 1.64 KB
/
bootstrap.yaml
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
45
46
47
48
49
50
51
52
53
54
- hosts: localhost
connection: local
vars:
deployments:
- cluster
- kam
- openshift-gitops-applicationset-controller
- openshift-gitops-redis
- openshift-gitops-repo-server
- openshift-gitops-server
tasks:
- name: Get Ingress from Cluster
k8s_info:
api_version: config.openshift.io/v1
kind: Ingress
name: cluster
namespace: openshift-ingress
register: ingress
- name: Get sub_domain from ingress
set_fact:
sub_domain: "{{ ingress | json_query('resources[0].spec.domain')}}"
- name: Get instance definition
set_fact:
openshift_gitops_cr: "{{ lookup('url', 'https://raw.githubusercontent.com/coolstore-demo/coolstore/main/infra/components/gitops-operator/instance/base/argocd-cr.yaml', split_lines=False) | replace('${SUB_DOMAIN}', sub_domain) }}"
- name: Output definition
debug:
msg: "{{ openshift_gitops_cr | to_nice_yaml }}"
- name: Update default gitops instance
k8s:
state: present
definition: "{{ openshift_gitops_cr }}"
- name: Sleep for 10 seconds
wait_for:
timeout: 10
- name: Check that all deployments are up and running
command: "oc rollout status deployment {{ item }} -n openshift-gitops"
with_items: "{{ deployments }}"
- name: Load bootstrap application
set_fact:
bootstrap: "{{ lookup('url', 'https://raw.githubusercontent.com/coolstore-demo/coolstore/main/bootstrap/argo/base/bootstrap.yaml', split_lines=False) }}"
- name: Create bootstrap application
k8s:
state: present
definition: "{{ bootstrap }}"