2017-09-27 20:13:39 +08:00
|
|
|
---
|
2019-05-14 20:51:32 +08:00
|
|
|
- name: set_fact container_exec_cmd mds
|
2017-09-28 00:22:15 +08:00
|
|
|
set_fact:
|
2019-05-14 20:51:32 +08:00
|
|
|
container_exec_cmd: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2017-09-27 20:13:39 +08:00
|
|
|
- name: generate systemd unit file
|
|
|
|
become: true
|
|
|
|
template:
|
|
|
|
src: "{{ role_path }}/templates/ceph-mds.service.j2"
|
|
|
|
dest: /etc/systemd/system/ceph-mds@.service
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
2019-04-01 23:46:15 +08:00
|
|
|
notify: restart ceph mdss
|
2017-09-27 20:13:39 +08:00
|
|
|
|
|
|
|
- name: systemd start mds container
|
|
|
|
systemd:
|
|
|
|
name: ceph-mds@{{ ansible_hostname }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2019-03-20 18:35:36 +08:00
|
|
|
masked: no
|
2017-09-27 20:13:39 +08:00
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: wait for mds socket to exist
|
2019-05-14 20:51:32 +08:00
|
|
|
command: "{{ container_exec_cmd }} sh -c 'stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok || stat /var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok'"
|
2018-10-30 22:51:32 +08:00
|
|
|
changed_when: false
|
2017-09-27 20:13:39 +08:00
|
|
|
register: multi_mds_socket
|
|
|
|
retries: 5
|
|
|
|
delay: 15
|
|
|
|
until: multi_mds_socket.rc == 0
|