2017-03-16 17:17:08 +08:00
|
|
|
---
|
2017-12-15 02:13:09 +08:00
|
|
|
- name: install ceph-mgr package on RedHat or SUSE
|
2017-10-09 21:26:15 +08:00
|
|
|
package:
|
|
|
|
name: ceph-mgr
|
|
|
|
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
|
|
|
|
when:
|
2017-12-15 02:13:09 +08:00
|
|
|
- ansible_os_family in ['RedHat', 'Suse']
|
2017-10-09 21:26:15 +08:00
|
|
|
|
|
|
|
- name: install ceph mgr for debian
|
|
|
|
apt:
|
|
|
|
name: ceph-mgr
|
|
|
|
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:
|
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
|
2017-03-16 17:17:08 +08:00
|
|
|
- name: create mgr directory
|
|
|
|
file:
|
|
|
|
path: /var/lib/ceph/mgr/
|
|
|
|
state: directory
|
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
|
|
|
mode: "0755"
|
|
|
|
|
|
|
|
- name: create mgr directory
|
|
|
|
file:
|
|
|
|
path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}
|
|
|
|
state: directory
|
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
|
|
|
mode: "0755"
|
|
|
|
|
|
|
|
- name: copy mgr key
|
|
|
|
copy:
|
|
|
|
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.mgr.{{ ansible_hostname }}.keyring"
|
|
|
|
dest: "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring"
|
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
|
|
|
mode: "0600"
|
|
|
|
when:
|
|
|
|
- cephx
|
|
|
|
|
|
|
|
- name: set mgr key permissions
|
|
|
|
file:
|
|
|
|
path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring
|
|
|
|
owner: "ceph"
|
|
|
|
group: "ceph"
|
|
|
|
mode: "0600"
|
|
|
|
when:
|
|
|
|
- cephx
|
|
|
|
|
2017-07-05 21:47:48 +08:00
|
|
|
- name: ensure systemd service override directory exists
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "/etc/systemd/system/ceph-mgr@.service.d/"
|
|
|
|
when:
|
|
|
|
- ceph_mgr_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
|
|
|
- name: add ceph-mgr systemd service overrides
|
|
|
|
config_template:
|
|
|
|
src: "ceph-mgr.service.d-overrides.j2"
|
|
|
|
dest: "/etc/systemd/system/ceph-mgr@.service.d/ceph-mgr-systemd-overrides.conf"
|
|
|
|
config_overrides: "{{ ceph_mgr_systemd_overrides | default({}) }}"
|
|
|
|
config_type: "ini"
|
|
|
|
when:
|
|
|
|
- ceph_mgr_systemd_overrides is defined
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
|
2017-03-16 17:17:08 +08:00
|
|
|
- name: start and add that the mgr service to the init sequence
|
|
|
|
service:
|
|
|
|
name: "ceph-mgr@{{ ansible_hostname }}"
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|