feat!: Rewrite configure script in ansible (#822)

* feat: smol changes

Signed-off-by: Devin Buhl <devin@buhl.casa>

* feat!: Rewrite configure script in ansible

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: add comment for real path

Signed-off-by: Devin Buhl <devin@buhl.casa>

* feat: verification is done

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: do not need net common

Signed-off-by: Devin Buhl <devin@buhl.casa>

* chore: clean up old comments

Signed-off-by: Devin Buhl <devin@buhl.casa>

* chore: clean up old comments

Signed-off-by: Devin Buhl <devin@buhl.casa>

* feat: finish up ansible host generation and more

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: backup/restore sops config between tasks

Signed-off-by: Devin Buhl <devin@buhl.casa>

* chore: clean up test comments

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: use ansible template on template

Signed-off-by: Devin Buhl <devin@buhl.casa>

* Update template/vars/config.sample.yaml

Co-authored-by: Manuel Rüger <manuel@rueg.eu>

* Update template/tasks/verify_cli.yaml

* chore: update readme

Signed-off-by: Devin Buhl <devin@buhl.casa>

* chore: update readme

Signed-off-by: Devin Buhl <devin@buhl.casa>

* Update README.md

Co-authored-by: Manuel Rüger <manuel@rueg.eu>

* fix: move bcrypt logic to template

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: derp

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
This commit is contained in:
Devin BuhlandManuel Rüger authored and GitHub committed 2023-07-04 11:36:58 -04:00
1 parent 26164c7278
commit de0ed1c70a
58 files changed
+698 -764

No files matched your search

+88
View File
@@ -0,0 +1,88 @@
---
version: "3"
tasks:
verify:
desc: Verify flux meets the prerequisites
cmds:
- flux check --pre
install:
desc: Install Flux into your cluster
cmds:
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/bootstrap
- cat {{.SOPS_AGE_KEY_FILE}} | kubectl -n flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets.sops.yaml | kubectl apply -f -
- kubectl apply -f {{.KUBERNETES_DIR}}/flux/vars/cluster-settings.yaml
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/flux/config
preconditions:
- sh: test -f {{.SOPS_AGE_KEY_FILE}}
msg: |
Age key file is not found. Did you forget to create it?
vars:
SOPS_AGE_KEY_FILE: ~/.config/sops/age/keys.txt
reconcile:
desc: Force update Flux to pull in changes from your Git repository
cmds:
- flux reconcile -n flux-system kustomization cluster --with-source
hr-restart:
desc: Restart all failed Helm Releases
cmds:
- kubectl get hr --all-namespaces | grep False | awk '{print $2, $1}' | xargs -L1 bash -c 'flux suspend hr $0 -n $1'
- kubectl get hr --all-namespaces | grep False | awk '{print $2, $1}' | xargs -L1 bash -c 'flux resume hr $0 -n $1'
nodes:
desc: List all the nodes in your cluster
cmds:
- kubectl get nodes {{.CLI_ARGS | default "-o wide"}}
pods:
desc: List all the pods in your cluster
cmds:
- kubectl get pods {{.CLI_ARGS | default "-A"}}
kustomizations:
desc: List all the kustomizations in your cluster
cmds:
- kubectl get kustomizations {{.CLI_ARGS | default "-A"}}
helmreleases:
desc: List all the helmreleases in your cluster
cmds:
- kubectl get helmreleases {{.CLI_ARGS | default "-A"}}
helmrepositories:
desc: List all the helmrepositories in your cluster
cmds:
- kubectl get helmrepositories {{.CLI_ARGS | default "-A"}}
gitrepositories:
desc: List all the gitrepositories in your cluster
cmds:
- kubectl get gitrepositories {{.CLI_ARGS | default "-A"}}
certificates:
desc: List all the certificates in your cluster
cmds:
- kubectl get certificates {{.CLI_ARGS | default "-A"}}
- kubectl get certificaterequests {{.CLI_ARGS | default "-A"}}
ingresses:
desc: List all the ingresses in your cluster
cmds:
- kubectl get ingress {{.CLI_ARGS | default "-A"}}
resources:
desc: Gather common resources in your cluster, useful when asking for support
cmds:
- task: nodes
- task: kustomizations
- task: helmreleases
- task: helmrepositories
- task: gitrepositories
- task: certificates
- task: ingresses
- task: pods