-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook.yml
More file actions
41 lines (40 loc) · 1.43 KB
/
Copy pathplaybook.yml
File metadata and controls
41 lines (40 loc) · 1.43 KB
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
---
- hosts: all
tasks:
- name: download k3d
ansible.builtin.command: curl https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh -o /tmp/installk3d.sh
args:
creates: /tmp/installk3d.sh
- name: install k3d
ansible.builtin.command: bash /tmp/installk3d.sh
args:
creates: /usr/local/bin/k3d
- name: download helm
ansible.builtin.command: curl -o /tmp/installhelm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
args:
creates: /tmp/installhelm.sh
- name: install helm
ansible.builtin.command: bash /tmp/installhelm.sh
args:
creates: /usr/local/bin/helm
- name: change permissions on helm
become: true
ansible.builtin.file:
path: /usr/local/bin/helm
mode: o=x
- name: download kubectl
ansible.builtin.command: curl -Lo /tmp/installkubectl https://dl.k8s.io/release/v1.31.0/bin/linux/amd64/kubectl
args:
creates: /tmp/installkubectl
- name: install kubectl
ansible.builtin.command: sudo install -o root -g root -m 0755 /tmp/installkubectl /usr/local/bin/kubectl
args:
creates: /usr/local/bin/kubectl
- name: create cluster
ansible.builtin.command: k3d cluster create local-k8s --volume '{{ lookup('ansible.builtin.env', 'PWD') }}'/storage:/var/storage
args:
creates: ~/.kube/config
- name: create persistent volume
kubernetes.core.k8s:
state: present
src: ./kube/persistent.yaml