Set up ansible scripts to install k3s, helm, and ArgoCD in a Debian-based node

This commit is contained in:
2025-08-15 21:06:56 -03:00
parent 700b770248
commit f6866e1a11
8 changed files with 90 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
- name: Set up ArgoCD
hosts: dev
become: true
tasks:
- name: Create ArgoCD namespace
kubernetes.core.k8s:
api_version: v1
kind: Namespace
name: argocd
kubeconfig: /etc/rancher/k3s/k3s.yaml
- name: Apply ArgoCD installation manifest
kubernetes.core.k8s:
state: present
src: https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
namespace: argocd
kubeconfig: /etc/rancher/k3s/k3s.yaml
- name: Get ArgoCD initial admin password
ansible.builtin.shell: kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}"
register: encoded_pass
changed_when: false
- name: Decode ArgoCD password
ansible.builtin.set_fact:
argocd_pass: "{{ encoded_pass.stdout | b64decode }}"
- name: Show ArgoCD password
ansible.builtin.debug:
msg: "ArgoCD admin password: {{ argocd_pass }}"