Newer
Older
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
---
- name: K8s customization
hosts: master
become: true
tasks:
- name: Git clone local-path-provisioner
git:
repo: https://github.com/rancher/local-path-provisioner.git
dest: "/root/git-local-path-provisioner"
clone: yes
update: no
version: v0.0.26
- name: Local path provisioner configuration
copy:
dest: /tmp/local-path-provisioner.yaml
mode: 0644
content: |
storageClass:
defaultClass: false
defaultVolumeType: hostPath
name: local-path
nodePathMap:
- node: DEFAULT_PATH_FOR_NON_LISTED_NODES
paths:
- /scratch
- name: Local path provisioner deployment
vars:
config: >-
--namespace local-path-storage
-f /tmp/local-path-provisioner.yaml
local-path-storage
/root/git-local-path-provisioner/deploy/chart/local-path-provisioner/
shell: |-
helm status --namespace local-path-storage local-path-storage
if [ $? -ne 0 ]; then
helm install {{ config }}
else
helm upgrade {{ config }}
fi
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
when: true