blob: 725c1add98dc5756b5028a4d3d478518abf2aca4 [file] [log] [blame]
Mohammed Naser0003fd02022-03-12 15:38:24 -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: install packages
16 ansible.builtin.apt:
17 name: ["ceph-mgr"]
18 install_recommends: false
19
20- name: create manager folder
21 ansible.builtin.file:
22 path: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}"
23 state: directory
Mohammed Naser511c3fa2022-03-17 17:54:10 -040024 owner: ceph
25 group: ceph
26 mode: 0700
Mohammed Naser0003fd02022-03-12 15:38:24 -050027
Mohammed Naser511c3fa2022-03-17 17:54:10 -040028- name: Create Ceph manager keyring
29 vexxhost.atmosphere.ceph_key:
30 name: "mgr.{{ inventory_hostname_short }}"
31 dest: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}/keyring"
32 caps:
33 mon: allow profile mgr
34 osd: allow *
35 mds: allow *
36 owner: ceph
37 group: ceph
Mohammed Naser0003fd02022-03-12 15:38:24 -050038
39- name: ensure permissions are fixed
40 ansible.builtin.file:
41 path: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}"
42 owner: ceph
43 group: ceph
Mohammed Naser511c3fa2022-03-17 17:54:10 -040044 recurse: true
Mohammed Naser0003fd02022-03-12 15:38:24 -050045
46- name: enable and start service
47 ansible.builtin.service:
48 name: "ceph-mgr@{{ inventory_hostname_short }}"
49 state: started
Mohammed Naser511c3fa2022-03-17 17:54:10 -040050 enabled: true