| # 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 |
| owner: ceph |
| group: ceph |
| mode: 0700 |
| |
| - name: Create Ceph manager keyring |
| vexxhost.atmosphere.ceph_key: |
| name: "mgr.{{ inventory_hostname_short }}" |
| dest: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}/keyring" |
| caps: |
| mon: allow profile mgr |
| osd: allow * |
| mds: allow * |
| owner: ceph |
| group: ceph |
| |
| - name: ensure permissions are fixed |
| ansible.builtin.file: |
| path: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}" |
| owner: ceph |
| group: ceph |
| recurse: true |
| |
| - name: enable and start service |
| ansible.builtin.service: |
| name: "ceph-mgr@{{ inventory_hostname_short }}" |
| state: started |
| enabled: true |