Set up ansible scripts to install k3s, helm, and ArgoCD in a Debian-based node
This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user