mirror of https://github.com/ceph/ceph-ansible.git
64 lines
2.3 KiB
YAML
64 lines
2.3 KiB
YAML
---
|
|
- name: install ceph mds for debian
|
|
apt:
|
|
name: ceph-mds
|
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
|
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_facts['distribution_release'] ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
|
|
when:
|
|
- mds_group_name in group_names
|
|
- ansible_facts['os_family'] == 'Debian'
|
|
register: result
|
|
until: result is succeeded
|
|
|
|
- name: install ceph-mds package on redhat or SUSE/openSUSE
|
|
package:
|
|
name: "ceph-mds"
|
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
|
register: result
|
|
until: result is succeeded
|
|
when:
|
|
- mds_group_name in group_names
|
|
- ansible_facts['os_family'] in ['Suse', 'RedHat']
|
|
|
|
- name: create mds keyring
|
|
command: ceph --cluster {{ cluster }} --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring auth get-or-create mds.{{ ansible_facts['hostname'] }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring
|
|
args:
|
|
creates: /var/lib/ceph/mds/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring
|
|
changed_when: false
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
|
when: cephx
|
|
|
|
- name: set mds key permissions
|
|
file:
|
|
path: /var/lib/ceph/mds/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring
|
|
owner: "ceph"
|
|
group: "ceph"
|
|
mode: "0600"
|
|
when: cephx
|
|
|
|
- name: ensure systemd service override directory exists
|
|
file:
|
|
state: directory
|
|
path: "/etc/systemd/system/ceph-mds@.service.d/"
|
|
when:
|
|
- ceph_mds_systemd_overrides is defined
|
|
- ansible_facts['service_mgr'] == 'systemd'
|
|
|
|
- name: add ceph-mds systemd service overrides
|
|
config_template:
|
|
src: "ceph-mds.service.d-overrides.j2"
|
|
dest: "/etc/systemd/system/ceph-mds@.service.d/ceph-mds-systemd-overrides.conf"
|
|
config_overrides: "{{ ceph_mds_systemd_overrides | default({}) }}"
|
|
config_type: "ini"
|
|
when:
|
|
- ceph_mds_systemd_overrides is defined
|
|
- ansible_facts['service_mgr'] == 'systemd'
|
|
|
|
- name: start and add that the metadata service to the init sequence
|
|
service:
|
|
name: ceph-mds@{{ ansible_facts['hostname'] }}
|
|
state: started
|
|
enabled: yes
|
|
masked: no
|
|
changed_when: false
|