# add logic for A & B and loop through steps
- name: Basic deploy of a service
  community.general.terraform:
    project_path: '../../terraform'
    state: present
    variables:
      cluster_name: "{{ item }}"
  loop:
    - karpenter
    - cas

# helm install baseline
- name: Deploy latest version of Prometheus chart inside monitoring namespace (and create it)
  kubernetes.core.helm:
    name: test
    chart_ref: stable/prometheus
    release_namespace: monitoring
    create_namespace: true

- name: Deploy baseline config chart from local path
  kubernetes.core.helm:
    name: baseline
    chart_ref: '../../helm'
    values:
      cluster_name: "{{ item }}"
  loop:
    - karpenter
    - cas

# deploy autoscaler
- name: Add cluster auto-sclaer chart repo
  kubernetes.core.helm_repository:
    name: autoscaler 
    repo_url: "https://kubernetes.github.io/autoscaler"
  when: 

- name: Deploy cluster auto-sclaer chart using set values
  kubernetes.core.helm:
    name: cas
    chart_ref: autoscaler/cluster-autoscaler
    release_namespace: cas
    set_values:
      - value: "'autoDiscovery.clusterName'=<CLUSTER NAME>"
        value_type: string
  when:

# configure autoscaler

# deploy karpenter
- name: Deploy cluster auto-sclaer chart using set values
  kubernetes.core.helm:
    name: karpenter
    chart_ref: pfeifferj/ibm-cloud-karpenter
    release_namespace: karpenter
  when:

# configure karpenter

