| # 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: mkfs monitor |
| ansible.builtin.shell: | |
| ceph-mon --mkfs -i {{ inventory_hostname_short }} --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring |
| args: |
| creates: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}/store.db" |
| |
| - name: ensure permissions are fixed |
| ansible.builtin.file: |
| path: "/var/lib/ceph/mon/ceph-{{ inventory_hostname_short }}" |
| owner: ceph |
| group: ceph |
| recurse: yes |
| |
| # NOTE(mnaser): https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1917414/comments/30 |
| - name: workaround for aarch64 systems |
| community.general.ini_file: |
| path: /lib/systemd/system/ceph-mon@.service |
| section: Service |
| option: MemoryDenyWriteExecute |
| value: false |
| register: _ceph_aarch64_fix |
| when: ansible_architecture == 'aarch64' |
| |
| - name: enable and start service |
| ansible.builtin.service: |
| name: "ceph-mon@{{ inventory_hostname_short }}" |
| state: started |
| enabled: yes |
| daemon_reload: "{{ _ceph_aarch64_fix.changed }}" |