-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
32 lines (27 loc) · 999 Bytes
/
Taskfile.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
---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
vars:
KUBERNETES_DIR: "{{.ROOT_DIR}}/kubernetes"
ANSIBLE_DIR: "{{.ROOT_DIR}}/server/ansible"
env:
KUBECONFIG: "{{.KUBERNETES_DIR}}/coffee-shop-2/kubeconfig"
includes:
ansible: .taskfiles/ansible.yml
flux: .taskfiles/flux.yml
sops: .taskfiles/sops.yml
nextcloud: .taskfiles/nextcloud.yml
db: .taskfiles/db.yml
bootstrap: .taskfiles/bootstrap.yml
tasks:
kubeconfig:
desc: Remotely fetch kubeconfig from k3s
vars:
cluster: '{{.cluster | default "coffee-shop-2"}}'
cmds:
- rsync --verbose --progress --partial --rsync-path="sudo rsync" [email protected]:/etc/rancher/k3s/k3s.yaml {{.KUBECONFIG}}
- '{{if eq OS "linux"}}sed -i{{else}}sed -i ""{{end}} "s/127.0.0.1/192.168.4.3/g" {{.KUBECONFIG}}'
- '{{if eq OS "linux"}}sed -i{{else}}sed -i ""{{end}} "s/default/{{.cluster}}/g" {{.KUBECONFIG}}'
- chmod go-r kubeconfig
silent: true
default: task -l