-
Notifications
You must be signed in to change notification settings - Fork 76
/
32_install_rook.yml
58 lines (54 loc) · 2.26 KB
/
32_install_rook.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: Prepare cluster to install rook
hosts: vm_host
run_once: true
vars_files:
- vars/k8s_cluster.yml
tasks:
- name: Configure Rook
when: rook_ceph.install_rook
block:
- name: Ensure the needed Namespaces exist.
kubernetes.core.k8s:
definition:
api_version: v1
kind: Namespace
metadata:
name: rook-ceph
kubeconfig: "{{ workspace_directory.base_path }}/clusters/{{ k8s.cluster_name | default('k8s-test', true) }}/admin.kubeconfig"
state: present
- name: Add helm chart repository for Rook
kubernetes.core.helm_repository:
name: "{{ item.name }}"
repo_url: "{{ item.repo_url }}"
loop:
- name: "{{ rook.operator.chart.name }}"
repo_url: "{{ rook.operator.chart.url }}"
- name: "{{ rook.cluster.chart.name }}"
repo_url: "{{ rook.cluster.chart.url }}"
- name: Ensure rook-operator helm chart is installed
kubernetes.core.helm:
name: rook-operator
chart_ref: "{{ rook.operator.chart.ref }}"
kubeconfig: "{{ workspace_directory.base_path }}/clusters/{{ k8s.cluster_name | default('k8s-test', true) }}/admin.kubeconfig"
release_namespace: rook-ceph
update_repo_cache: true
values:
csi:
provisionerReplicas: "{{ rook_ceph.rook_cluster_size }}"
wait: true
- name: Trigger rook template
ansible.builtin.template:
src: templates/rook-values.yml.j2
dest: /tmp/{{ k8s.cluster_name | default('k8s-test', true) }}/rook-values.yaml
mode: "0755"
- name: Ensure rook-ceph-cluster helm chart is installed
kubernetes.core.helm:
name: rook-ceph-cluster
chart_ref: "{{ rook.cluster.chart.ref }}"
kubeconfig: "{{ workspace_directory.base_path }}/clusters/{{ k8s.cluster_name | default('k8s-test', true) }}/admin.kubeconfig"
release_namespace: rook-ceph
update_repo_cache: true
values_files:
- /tmp/{{ k8s.cluster_name | default('k8s-test', true) }}/rook-values.yaml
wait: true