generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
43 lines (37 loc) · 1.4 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
---
version: "3"
vars:
PROJECT_DIR:
sh: "git rev-parse --show-toplevel"
CLUSTER_DIR: "{{.PROJECT_DIR}}/cluster"
ANSIBLE_DIR: "{{.PROJECT_DIR}}/provision/ansible"
TERRAFORM_DIR: "{{.PROJECT_DIR}}/provision/terraform"
# env:
# KUBECONFIG: "{{.PROJECT_DIR}}/provision/kubeconfig"
includes:
cluster: .taskfiles/ClusterTasks.yml
debug: .taskfiles/DebugTasks.yml
precommit: .taskfiles/PreCommitTasks.yml
rook: .taskfiles/RookTasks.yml
ansible: .taskfiles/ansible.yml
flux: .taskfiles/Flux/Taskfile.yaml
format: .taskfiles/format.yml
lint: .taskfiles/lint.yml
terraform: .taskfiles/terraform.yml
tasks:
# kubeconfig:
# desc: Remotely fetch kubeconfig from Kubernetes
# cmds:
# - rsync --verbose --progress --partial --rsync-path="sudo rsync" {{.K3S_PRIMARY_MASTER_NODE_USERNAME}}@{{.K3S_PRIMARY_MASTER_NODE_ADDR}}:/etc/rancher/k3s/k3s.yaml "${KUBECONFIG}"
# - sed -i '' 's/127.0.0.1/{{.K3S_LB_ADDR}}/g' "${KUBECONFIG}"
# - chmod go-r "${KUBECONFIG}"
# vars:
# K3S_PRIMARY_MASTER_NODE_USERNAME: root
# K3S_PRIMARY_MASTER_NODE_ADDR: 192.168.42.10
# K3S_LB_ADDR: 192.168.1.1
ansible:
desc: Install/Upgrade Ansible deps
dir: ansible
cmds:
- ansible-galaxy install -r requirements.yml --roles-path ~/.ansible/roles --force
- ansible-galaxy collection install -r requirements.yml --collections-path ~/.ansible/collections --force