-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathargocd-install.yml
67 lines (59 loc) · 1.58 KB
/
argocd-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
- name: Install Argo CD
hosts: localhost
become: yes
tasks:
- name: Create argocd namespace
shell: kubectl create namespace argocd
ignore_errors: yes
- name: Add Argo CD repository
shell: helm repo add argo https://argoproj.github.io/argo-helm
ignore_errors: yes
- name: Update repository using Helm
shell: helm repo update
ignore_errors: yes
- name: Install Argo CD using Helm
shell: helm install -n argocd argocd argo/argo-cd
environment:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
ignore_errors: yes
- name: Create Ingress for Argo CD
shell: |
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-ingress
namespace: argocd
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
ingressClassName: nginx
rules:
- host: argocd.sysadmin.homes
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argocd-server
port:
number: 443
EOF
ignore_errors: yes
- name: Pause for 1 minute to allow Argo CD to initialize
pause:
minutes: 1
- name: Get argocd-cm configmap
shell: kubectl -n argocd get configmap argocd-cm -o yaml > /tmp/argocd-cm.yml
ignore_errors: yes
- name: Update argocd-cm configmap
replace:
path: /tmp/argocd-cm.yml
regexp: 'example.com'
replace: 'sysadmin.homes'
ignore_errors: yes
- name: Apply the modified argocd-cm configmap
shell: kubectl apply -f /tmp/argocd-cm.yml
ignore_errors: yes