blob: 43e8498b0a2674632ef57d40405b951b0e82d19f [file] [log] [blame]
Mohammed Naserb7b97d62022-03-12 16:30:00 -05001# Copyright (c) 2022 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15- name: collect facts for all monitors
16 run_once: true
17 delegate_to: "{{ item }}"
18 delegate_facts: true
19 ansible.builtin.setup:
20 gather_subset: network
21 loop: "{{ groups[ceph_csi_rbd_mons_group] }}"
22
23- vexxhost.atmosphere.ceph_pool:
24 name: "{{ ceph_csi_rbd_pool }}"
25 application: rbd
26 pg_autoscale_mode: on
27
28- vexxhost.atmosphere.ceph_key:
29 name: "{{ ceph_csi_rbd_user }}"
30 caps:
31 mon: profile rbd
32 mgr: profile rbd pool={{ ceph_csi_rbd_pool }}
33 osd: profile rbd pool={{ ceph_csi_rbd_pool }}
34
35- vexxhost.atmosphere.ceph_key:
36 name: "{{ ceph_csi_rbd_user }}"
37 state: info
38 output_format: json
39 register: _ceph_key
40
41- ansible.builtin.set_fact:
42 _ceph_rbd_csi_ceph_keyring: "{{ _ceph_key.stdout | from_json | first }}"
43
44- kubernetes.core.helm:
45 name: ceph-csi-rbd
46 chart_ref: ceph/ceph-csi-rbd
47 chart_version: 3.5.1
48 release_namespace: kube-system
49 kubeconfig: /etc/kubernetes/admin.conf
50 values:
51 csiConfig:
52 - clusterID: "{{ ceph_mon_fsid }}"
53 monitors: "{{ groups[ceph_csi_rbd_mons_group] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) }}"
54 nodeplugin:
55 httpMetrics:
56 containerPort: 8081
57 provisioner:
58 nodeSelector:
59 openstack-control-plane: enabled
60 storageClass:
61 create: true
62 name: general
63 annotations:
64 storageclass.kubernetes.io/is-default-class: "true"
65 clusterID: "{{ ceph_csi_rbd_ceph_fsid }}"
66 pool: "{{ ceph_csi_rbd_pool }}"
67 mountOptions:
68 - discard
69 secret:
70 create: true
71 userID: "{{ ceph_csi_rbd_id }}"
72 userKey: "{{ _ceph_rbd_csi_ceph_keyring.key }}"