---
- 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"
  with_items:
    - keycloak

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


- name: 5. Change a Elasticsearch Service (NodePort=elasticsearch_nodePort)
  kubernetes.core.k8s:
    state: present
    definition:
      apiVersion: v1
      kind: Service
      metadata:
        name: "{{ elasticsearch_service_name }}"
        namespace: "{{ cmoa_namespace }}"
      spec:
        type: NodePort
        ports:
        - protocol: TCP
          port: "{{ elasticsearch_service_port }}"
          nodePort: "{{ elasticsearch_nodePort }}"
    apply: yes
