Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ansible/roles/mno-post-cluster-install/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ http_store_port: 8081
registry_host: "{{ groups['bastion'][0] }}"
registry_port: 5000

# Wait until cluster is stable vars
wait_until_cluster_stable: true
minimum_stable_period: 2m
wait_until_cluster_stable_timeout: 20m

# Deploy performance-dashboards
setup_performance_dashboards: false

Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/mno-post-cluster-install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
- name: kubeconfig
dest: kubeconfig.backup

- name: Wait until cluster is stable
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc adm wait-for-stable-cluster --minimum-stable-period={{ minimum_stable_period }} --timeout={{ wait_until_cluster_stable_timeout }}
when: wait_until_cluster_stable

- name: Apply a label to the worker node(s)
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc label no --overwrite -l node-role.kubernetes.io/worker jetlag=true
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/sno-post-cluster-install/defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
assisted_installer_host: "{{ groups['bastion'][0] }}"
assisted_installer_port: 8090

# Wait until cluster is stable vars
wait_until_cluster_stable: true
minimum_stable_period: 2m
wait_until_cluster_stable_timeout: 20m

# Deploy openshift-gitops-operator
setup_openshift_gitops: false
gitops_channel: stable
Expand Down
40 changes: 6 additions & 34 deletions ansible/roles/sno-post-cluster-install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
- name: kubeconfig
dest: kubeconfig.backup

- name: Wait until cluster is stable
shell: |
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 }}
when: wait_until_cluster_stable

- name: Apply a label to the SNO node
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc label no --all --overwrite jetlag=true
register: jetlag_label
retries: 120
delay: 2
until: not jetlag_label.failed

- name: Place templated configuration items
template:
Expand All @@ -58,68 +59,39 @@
- name: Add kube-burner sa
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc create sa kubeburner
register: kubeburner_sa
retries: 120
delay: 2
until: not kubeburner_sa.failed
when: setup_kube_burner_sa | default(true) | bool

- name: Add cluster-admin role to kube-burner sa
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc adm policy add-cluster-role-to-user -z kubeburner cluster-admin
register: kubeburner_role
retries: 120
delay: 2
until: not kubeburner_role.failed
when: setup_kube_burner_sa | default(true) | bool

- name: Disable default OperatorHub sources on bastion registry clusters
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc patch OperatorHub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
register: operator_hub_disable
retries: 120
delay: 2
until: not operator_hub_disable.failed
when:
- use_bastion_registry | default(false)
when: use_bastion_registry | default(false)

- name: Create openshift-marketplace namespace for ocp 4.15 and higher releases DUs
shell: |
KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc apply -f {{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/openshift-marketplace-ns.yaml
register: marketplace_ns
retries: 120
delay: 2
until: not marketplace_ns.failed
when:
- use_bastion_registry | default(false)
- openshift_version is version('4.15', ">=")

- name: Apply olm-mirror imageContentSourcePolicy on bastion registry clusters
shell: |
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
register: icsp_apply
retries: 120
delay: 2
until: not icsp_apply.failed
when: use_bastion_registry | default(false)

# Part of DU Profile (Not completely in du_profile_tasks.yml)
- name: Annotate catalogSource.yaml to pin opm to reserved cores for DUs
shell: |
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
register: catsource_annotate
retries: 120
delay: 2
until: not catsource_annotate.failed
when: use_bastion_registry | default(false) and du_profile

- name: Apply olm-mirror catalogSource on bastion registry clusters
shell: |
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
register: catsource_apply
retries: 120
delay: 2
until: not catsource_apply.failed
when: use_bastion_registry | default(false)

- name: Install OpenShift-gitops-operator
Expand Down