blob: 9ee70eee9eac07f3099d7b36428d87438c65ae5b [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
Tadas Sutkaitis4ace4182023-02-27 04:31:52 +020015- name: Install packages
Mohammed Naser0003fd02022-03-12 15:38:24 -050016 ansible.builtin.apt:
17 name: ["ceph-mgr"]
18 install_recommends: false
19
Tadas Sutkaitis4ace4182023-02-27 04:31:52 +020020- name: Create manager folder
Mohammed Naser0003fd02022-03-12 15:38:24 -050021 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
Tadas Sutkaitis4ace4182023-02-27 04:31:52 +020026 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
Tadas Sutkaitis4ace4182023-02-27 04:31:52 +020039- name: Ensure permissions are fixed
Mohammed Naser0003fd02022-03-12 15:38:24 -050040 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
Tadas Sutkaitis4ace4182023-02-27 04:31:52 +020046- name: Enable and start service
Mohammed Naser0003fd02022-03-12 15:38:24 -050047 ansible.builtin.service:
48 name: "ceph-mgr@{{ inventory_hostname_short }}"
49 state: started
Mohammed Naser511c3fa2022-03-17 17:54:10 -040050 enabled: true