Skip to content

Commit

Permalink
Check MachineSet readiness properly
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Stejskal <[email protected]>
  • Loading branch information
Frawless committed Nov 6, 2023
1 parent b12a2d3 commit de8a4a7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
kubeconfig: "{{ kubeconfig_path }}/{{ worker.name }}"
namespace: "openshift-machine-api"
kind: MachineSet
api_version: machine.openshift.io/v1beta1
name: "{{ worker.name }}-{{ machine_pool.node_type }}-worker-0"
wait: true
wait_timeout: 1800
Expand All @@ -44,6 +45,12 @@
loop: "{{ worker.machine_pools }}"
loop_control:
loop_var: machine_pool
register: machine_sets_wait

- name: Fail if MachineSets are not available
ansible.builtin.fail:
msg: "Machine sets are not available -> {{ machine_sets_wait.msg }}"
when: machine_sets_wait.results[0].resources == []

- name: Delete original machine-set on {{ worker.name }}
shell: "oc delete machineset -n openshift-machine-api {{ get_cluster_id_out.stdout }}-worker-0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
retries: 20
delay: 5

- name: "Create Certificate Issuer"
- name: "Create Certificate Issuer on {{ cluster_name }}"
kubernetes.core.k8s:
kubeconfig: "{{ kubeconfig_path }}/{{ cluster_name }}"
namespace: "{{ cm_operator_namespace }}"
Expand All @@ -75,7 +75,7 @@
verify_ssl: no
template: "templates/cert-manager/02-cluster-issuer.yaml.j2"

- name: "Create Certificate"
- name: "Create Certificate on {{ cluster_name }}"
kubernetes.core.k8s:
kubeconfig: "{{ kubeconfig_path }}/{{ cluster_name }}"
namespace: "{{ cm_operator_namespace }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: "Wait for Certificate secret creation"
- name: "Wait for Certificate secret creation on {{ cluster_name }}"
kubernetes.core.k8s_info:
kubeconfig: "{{ kubeconfig_path }}/{{ cluster_name }}"
namespace: "openshift-config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
kind: Deployment
name: loki-operator-controller-manager
wait: true
wait_sleep: 10
wait_timeout: 600
verify_ssl: no
wait_condition:
type: Available
status: True
reason: MinimumReplicasAvailable
retries: 20
delay: 5

- name: "Create Loki access secret on {{ clusterName }}"
kubernetes.core.k8s:
Expand Down
3 changes: 3 additions & 0 deletions install/roles/tealc/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

- include_tasks:
file: infra-setup/install/hive/create-superadmin.yaml
apply:
tags: [superuser, infra, never]
tags: [superuser, infra, never]
loop: "{{ clusters }}"
loop_control:
loop_var: cluster_name
Expand Down

0 comments on commit de8a4a7

Please sign in to comment.