---

- name: Setup gitea Secret
  become: yes
  kubernetes.core.k8s:
    state: present
    template: 'gitea-secret.j2'
  when:
  - argocd_bootstrap_infrastructure
  - inventory_hostname == groups['kube_control_plane'][0]
  tags:
    - argo-cd

- name: Setup Harbor Secret
  become: yes
  kubernetes.core.k8s:
    state: present
    template: 'harbor-secret.j2'
  when:
  - argocd_bootstrap_infrastructure
  - inventory_hostname == groups['kube_control_plane'][0]
  tags:
    - argo-cd

- name: Setup argocd application for bootstrap
  become: yes
  kubernetes.core.k8s:
    state: present
    template: 'bootstrap-application.j2'
  when:
  - argocd_bootstrap_infrastructure
  - inventory_hostname == groups['kube_control_plane'][0]
  tags:
    - argo-cd

- name: Setup argocd infrastructure project
  become: yes
  kubernetes.core.k8s:
    state: present
    template: 'project-infrastructure.j2'
  when:
  - argocd_bootstrap_infrastructure
  - inventory_hostname == groups['kube_control_plane'][0]
  tags:
    - argo-cd
