70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
---
|
|
- name: Add ArgoCD Helm repository
|
|
command: /snap/bin/helm repo add argo https://argoproj.github.io/argo-helm
|
|
become: false
|
|
changed_when: false
|
|
|
|
- name: Update Helm repositories
|
|
command: /snap/bin/helm repo update
|
|
become: false
|
|
changed_when: false
|
|
|
|
- name: Install/Upgrade ArgoCD
|
|
command: >
|
|
/snap/bin/helm upgrade --install argocd argo/argo-cd
|
|
--namespace argocd
|
|
--create-namespace
|
|
--set configs.params."server\.insecure"=true
|
|
--wait
|
|
become: false
|
|
register: argocd_install
|
|
changed_when: "'Release \"argocd\" does not exist' in argocd_install.stdout or 'Happy Helming' in argocd_install.stdout"
|
|
|
|
- name: Create HTTPRoute for ArgoCD
|
|
kubernetes.core.k8s:
|
|
definition:
|
|
apiVersion: gateway.networking.k8s.io/v1
|
|
kind: HTTPRoute
|
|
metadata:
|
|
name: argocd-route
|
|
namespace: argocd
|
|
spec:
|
|
parentRefs:
|
|
- name: main-gateway
|
|
namespace: traefik
|
|
sectionName: argocd-https
|
|
hostnames:
|
|
- "argocd.svc.pguia.com"
|
|
rules:
|
|
- matches:
|
|
- path:
|
|
type: PathPrefix
|
|
value: /
|
|
backendRefs:
|
|
- name: argocd-server
|
|
port: 80
|
|
|
|
- name: Bootstrap App of Apps
|
|
kubernetes.core.k8s:
|
|
definition:
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Application
|
|
metadata:
|
|
name: apps
|
|
namespace: argocd
|
|
spec:
|
|
project: default
|
|
source:
|
|
repoURL: https://git.svc.pguia.com/guipguia/argocd.git
|
|
targetRevision: HEAD
|
|
path: apps
|
|
directory:
|
|
recurse: true
|
|
destination:
|
|
server: https://kubernetes.default.svc
|
|
namespace: argocd
|
|
syncPolicy:
|
|
automated:
|
|
prune: true
|
|
selfHeal: true
|