ceph-ansible/roles/ceph-mon/tasks/deploy_monitors.yml

26 lines
841 B
YAML

---
- name: create monitor initial keyring
command: >
ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --add-key={{ monitor_secret | mandatory }} --cap mon 'allow *'
creates=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
- name: set initial monitor key permissions
file: >
path=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
mode=0600
owner=root
group=root
- name: create monitor directory
file: >
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}
state=directory
owner=root
group=root
mode=0755
- name: ceph monitor mkfs
command: >
ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring