2015-01-21 01:43:47 +08:00
|
|
|
---
|
2017-10-09 21:37:51 +08:00
|
|
|
- name: install ceph mds for debian
|
|
|
|
apt:
|
|
|
|
name: ceph-mds
|
|
|
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
|
2017-10-09 21:37:51 +08:00
|
|
|
when:
|
|
|
|
- mds_group_name in group_names
|
|
|
|
- ansible_os_family == 'Debian'
|
2018-12-20 17:00:26 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-10-09 21:37:51 +08:00
|
|
|
|
2019-08-22 00:17:00 +08:00
|
|
|
- name: install ceph-mds package on redhat or SUSE/openSUSE
|
2017-10-09 21:37:51 +08:00
|
|
|
package:
|
|
|
|
name: "ceph-mds"
|
|
|
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-10-09 21:37:51 +08:00
|
|
|
when:
|
|
|
|
- mds_group_name in group_names
|
2019-08-15 04:48:34 +08:00
|
|
|
- ansible_os_family in ['Suse', 'RedHat']
|
2017-10-09 21:37:51 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: create mds keyring
|
2020-10-24 06:03:49 +08:00
|
|
|
ceph_key:
|
|
|
|
name: "mds.{{ ansible_hostname }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
user: client.bootstrap-mds
|
|
|
|
user_key: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring"
|
|
|
|
caps:
|
|
|
|
mon: "allow profile mds"
|
|
|
|
mds: "allow"
|
|
|
|
osd: "allow rwx"
|
|
|
|
dest: "/var/lib/ceph/mds/{{ cluster }}-{{ ansible_hostname }}/keyring"
|
|
|
|
import_key: false
|
|
|
|
owner: ceph
|
|
|
|
group: ceph
|
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
when: cephx | bool
|
2015-01-21 01:43:47 +08:00
|
|
|
|
2017-07-05 21:47:48 +08:00
|
|
|
- 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
|
2018-02-25 09:44:07 +08:00
|
|
|
- ansible_service_mgr == 'systemd'
|
2017-07-05 21:47:48 +08:00
|
|
|
|
|
|
|
- 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_service_mgr == 'systemd'
|
|
|
|
|
2017-01-20 17:14:35 +08:00
|
|
|
- name: start and add that the metadata service to the init sequence
|
2015-11-21 05:34:29 +08:00
|
|
|
service:
|
2020-07-22 03:27:59 +08:00
|
|
|
name: ceph-mds@{{ ansible_hostname }}
|
2015-11-21 05:34:29 +08:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
2019-03-20 18:35:36 +08:00
|
|
|
masked: no
|
2015-11-21 05:34:29 +08:00
|
|
|
changed_when: false
|