Skip to content

Commit

Permalink
Added task to wait for GitOps plugin activation
Browse files Browse the repository at this point in the history
  • Loading branch information
nsilla committed Oct 18, 2024
1 parent 17f4128 commit 77e536d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions roles/configure_ztp_gitops_apps/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,20 @@
.dockerconfigjson: "{{ _czga_encoded_pull_secret['content'] }}"
no_log: true

- name: Wait for the GitOps ZTP plugin activation
community.kubernetes.k8s_info:
api_version: v0
kind: Pod
namespace: openshift-gitops
label_selectors:
- app.kubernetes.io/name = openshift-gitops-repo-server
register: repo_server_pod
retries: 39
delay: 14
until:
- repo_server_pod.resources[-1] | community.general.json_query("status.conditions[?type=='Ready'].status") == ["True"]
- '"kustomize" in repo_server_pod.resources[-1] | community.general.json_query("spec.volumes[].name")'

- name: Run the policies and cluster apps
ansible.builtin.shell: |
{{ czga_oc_tool_path }} --kubeconfig="{{ temp_dir.path }}/kubeconfig" apply -k "{{ temp_dir.path }}/ztp/argocd/deployment"
Expand Down

0 comments on commit 77e536d

Please sign in to comment.