---
- name: 1. helmchart install (keycloak)
  kubernetes.core.helm:
    name: "{{item}}"
    release_name: "{{item}}"
    release_namespace: "{{ cmoa_namespace }}"
    chart_ref: "{{ role_path }}/files/04-keycloak"
    create_namespace: yes
    release_state: present
    values_files:
    - "{{ role_path }}/files/04-keycloak/values.yaml"
    values:
      image:
        repository: "{{ REGISTRY }}/cmoa3/keycloak"
      imagePullSecrets:
        - name: "{{ PullSecret }}"
      extraInitContainers: |
        - name: theme-provider
          image: "{{ REGISTRY }}/cmoa3/theme-provider:latest"
          imagePullPolicy: IfNotPresent
          command:
            - sh
          args:
            - -c
            - |
              echo "Copying theme ..."
              cp -R /mytheme/* /theme
      pgchecker:
        image:
          repository: "{{ REGISTRY }}/cmoa3/busybox"
    volumeMounts:
      - name: theme
        mountPath: /theme
  with_items:
    - keycloak

- name: 4. Check Kubernetes Pods (base)
  command: "{{ role_path }}/files/k8s_status {{ cmoa_namespace }}"

