forked from pavelanni/ocp4-deployment-homework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster_logging.yml
69 lines (55 loc) · 1.87 KB
/
cluster_logging.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
- hosts: localhost
tasks:
- name: Create a namespace for Elasticserach Operator
k8s:
state: present
src: files/eo-namespace.yaml
- name: Create a namespace for Cluster Logging Operator
k8s:
state: present
src: files/clo-namespace.yaml
- name: Create an Operator Group object for Elasticsearch
k8s:
state: present
src: files/eo-og.yaml
- name: Create a CatalogSourceConfig object for Elasticsearch operator
k8s:
state: present
src: files/eo-csc.yaml
- name: Run the oc command to get the channel
command: oc get packagemanifest elasticsearch-operator -n openshift-marketplace -o jsonpath='{.status.channels[].name}'
register: r_channel
- name: Set the channel variable
set_fact:
channel: "{{ r_channel.stdout }}"
- name: Change the Subscription YAML file for Elasticsearch operator
lineinfile:
path: files/eo-sub.yaml
regexp: '^ channel:'
line: ' channel: "{{ channel }}"'
# Apparently Ansible k8s doesn't support generateName so we have to use command here
# https://github.com/openshift/openshift-restclient-python/issues/279
- name: Create a Subscription object for Elasticsearch operator
command: oc create -f files/eo-sub.yaml
- name: Create an RBAC object
k8s:
state: present
src: files/eo-rbac.yaml
- name: Create an Operator Group object for ClusterLogging
command: oc create -f files/clo-og.yaml
- name: Create a CatalogSourceConfig object for ClusterLogging operator
k8s:
state: present
src: files/clo-csc.yaml
- name: Create a Subscription object for ClusterLogging operator
k8s:
state: present
src: files/clo-sub.yaml
- name: Pause for 1 minute
pause:
minutes: 1
- name: Create a ClusterLogging instance
k8s:
state: present
src: files/clusterlogging-instance.yaml