|
27 | 27 | - name: kubeconfig
|
28 | 28 | dest: kubeconfig.backup
|
29 | 29 |
|
| 30 | +- name: Wait until cluster is stable |
| 31 | + shell: | |
| 32 | + KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc adm wait-for-stable-cluster --minimum-stable-period={{ minimum_stable_period }} --timeout={{ wait_until_cluster_stable_timeout }} |
| 33 | + when: wait_until_cluster_stable |
| 34 | + |
30 | 35 | - name: Apply a label to the SNO node
|
31 | 36 | shell: |
|
32 | 37 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc label no --all --overwrite jetlag=true
|
33 |
| - register: jetlag_label |
34 |
| - retries: 120 |
35 |
| - delay: 2 |
36 |
| - until: not jetlag_label.failed |
37 | 38 |
|
38 | 39 | - name: Place templated configuration items
|
39 | 40 | template:
|
|
58 | 59 | - name: Add kube-burner sa
|
59 | 60 | shell: |
|
60 | 61 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc create sa kubeburner
|
61 |
| - register: kubeburner_sa |
62 |
| - retries: 120 |
63 |
| - delay: 2 |
64 |
| - until: not kubeburner_sa.failed |
65 | 62 | when: setup_kube_burner_sa | default(true) | bool
|
66 | 63 |
|
67 | 64 | - name: Add cluster-admin role to kube-burner sa
|
68 | 65 | shell: |
|
69 | 66 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc adm policy add-cluster-role-to-user -z kubeburner cluster-admin
|
70 |
| - register: kubeburner_role |
71 |
| - retries: 120 |
72 |
| - delay: 2 |
73 |
| - until: not kubeburner_role.failed |
74 | 67 | when: setup_kube_burner_sa | default(true) | bool
|
75 | 68 |
|
76 | 69 | - name: Disable default OperatorHub sources on bastion registry clusters
|
77 | 70 | shell: |
|
78 | 71 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc patch OperatorHub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
|
79 |
| - register: operator_hub_disable |
80 |
| - retries: 120 |
81 |
| - delay: 2 |
82 |
| - until: not operator_hub_disable.failed |
83 |
| - when: |
84 |
| - - use_bastion_registry | default(false) |
| 72 | + when: use_bastion_registry | default(false) |
85 | 73 |
|
86 | 74 | - name: Create openshift-marketplace namespace for ocp 4.15 and higher releases DUs
|
87 | 75 | shell: |
|
88 | 76 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc apply -f {{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/openshift-marketplace-ns.yaml
|
89 |
| - register: marketplace_ns |
90 |
| - retries: 120 |
91 |
| - delay: 2 |
92 |
| - until: not marketplace_ns.failed |
93 | 77 | when:
|
94 | 78 | - use_bastion_registry | default(false)
|
95 | 79 | - openshift_version is version('4.15', ">=")
|
96 | 80 |
|
97 | 81 | - name: Apply olm-mirror imageContentSourcePolicy on bastion registry clusters
|
98 | 82 | shell: |
|
99 | 83 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc apply -f {{ bastion_cluster_config_dir }}/olm-mirror-{{ operator_index_name }}-{{ operator_index_tag }}/imageContentSourcePolicy.yaml
|
100 |
| - register: icsp_apply |
101 |
| - retries: 120 |
102 |
| - delay: 2 |
103 |
| - until: not icsp_apply.failed |
104 | 84 | when: use_bastion_registry | default(false)
|
105 | 85 |
|
106 | 86 | # Part of DU Profile (Not completely in du_profile_tasks.yml)
|
107 | 87 | - name: Annotate catalogSource.yaml to pin opm to reserved cores for DUs
|
108 | 88 | shell: |
|
109 | 89 | yq -i '.metadata.annotations."target.workload.openshift.io/management" = "{\"effect\": \"PreferredDuringScheduling\"}"' {{ bastion_cluster_config_dir }}/olm-mirror-{{ operator_index_name }}-{{ operator_index_tag }}/catalogSource.yaml
|
110 |
| - register: catsource_annotate |
111 |
| - retries: 120 |
112 |
| - delay: 2 |
113 |
| - until: not catsource_annotate.failed |
114 | 90 | when: use_bastion_registry | default(false) and du_profile
|
115 | 91 |
|
116 | 92 | - name: Apply olm-mirror catalogSource on bastion registry clusters
|
117 | 93 | shell: |
|
118 | 94 | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc apply -f {{ bastion_cluster_config_dir }}/olm-mirror-{{ operator_index_name }}-{{ operator_index_tag }}/catalogSource.yaml
|
119 |
| - register: catsource_apply |
120 |
| - retries: 120 |
121 |
| - delay: 2 |
122 |
| - until: not catsource_apply.failed |
123 | 95 | when: use_bastion_registry | default(false)
|
124 | 96 |
|
125 | 97 | - name: Install OpenShift-gitops-operator
|
|
0 commit comments