Mohammed Naser | 0003fd0 | 2022-03-12 15:38:24 -0500 | [diff] [blame^] | 1 | # 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 |
| 24 | |
| 25 | - name: create mgr keyring |
| 26 | ansible.builtin.shell: | |
| 27 | 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 |
| 28 | args: |
| 29 | creates: "/var/lib/ceph/mgr/ceph-{{ inventory_hostname_short }}/keyring" |
| 30 | |
| 31 | - name: ensure permissions are fixed |
| 32 | ansible.builtin.file: |
| 33 | path: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}" |
| 34 | owner: ceph |
| 35 | group: ceph |
| 36 | recurse: yes |
| 37 | |
| 38 | - name: enable and start service |
| 39 | ansible.builtin.service: |
| 40 | name: "ceph-mgr@{{ inventory_hostname_short }}" |
| 41 | state: started |
| 42 | enabled: yes |