ceph-ansible/roles/ceph-mds/tasks/non_containerized.yml

88 lines
2.7 KiB
YAML
Raw Normal View History

---
- 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(omit) }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}"
when:
- mds_group_name in group_names
- ansible_os_family == 'Debian'
- name: install redhat ceph-mds package
package:
name: "ceph-mds"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when:
- mds_group_name in group_names
- ansible_os_family == 'RedHat'
- name: create bootstrap-mds directory
file:
path: /var/lib/ceph/bootstrap-mds/
state: directory
owner: "ceph"
group: "ceph"
mode: "0755"
- name: copy mds bootstrap key
2015-10-19 10:56:02 +08:00
copy:
src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
dest: "{{ item.name }}"
owner: "ceph"
group: "ceph"
mode: "0600"
with_items:
- { name: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true }
- { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
when:
- cephx
- item.copy_key|bool
- name: create mds directory
file:
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}
state: directory
owner: "ceph"
group: "ceph"
mode: "0755"
- 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.{{ mds_name }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring
2015-10-19 10:56:02 +08:00
args:
creates: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring
changed_when: false
when: cephx
- name: set mds key permissions
file:
path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/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_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_service_mgr == 'systemd'
- name: start and add that the metadata service to the init sequence
service:
name: ceph-mds@{{ mds_name }}
state: started
enabled: yes
changed_when: false