Added Ceph deployment
Change-Id: If9d6de15dc083346b90b6946571369bcf94849ea
diff --git a/roles/ceph_mgr/tasks/main.yml b/roles/ceph_mgr/tasks/main.yml
new file mode 100644
index 0000000..879928b
--- /dev/null
+++ b/roles/ceph_mgr/tasks/main.yml
@@ -0,0 +1,42 @@
+# Copyright (c) 2022 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: install packages
+ ansible.builtin.apt:
+ name: ["ceph-mgr"]
+ install_recommends: false
+
+- name: create manager folder
+ ansible.builtin.file:
+ path: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}"
+ state: directory
+
+- name: create mgr keyring
+ ansible.builtin.shell: |
+ ceph auth get-or-create mgr.{{ inventory_hostname_short }} mon 'allow profile mgr' osd 'allow *' mds 'allow *' > /var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}/keyring
+ args:
+ creates: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}/keyring"
+
+- name: ensure permissions are fixed
+ ansible.builtin.file:
+ path: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}"
+ owner: ceph
+ group: ceph
+ recurse: yes
+
+- name: enable and start service
+ ansible.builtin.service:
+ name: "ceph-mgr@{{ inventory_hostname_short }}"
+ state: started
+ enabled: yes