2015-03-26 22:43:54 +08:00
|
|
|
---
|
2016-02-02 22:10:24 +08:00
|
|
|
- name: activate monitor with upstart
|
2015-11-17 23:10:02 +08:00
|
|
|
file:
|
2016-03-29 21:37:31 +08:00
|
|
|
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/{{ item }}
|
2015-11-17 23:10:02 +08:00
|
|
|
state: touch
|
2016-02-02 22:10:24 +08:00
|
|
|
owner: "{{ activate_file_owner }}"
|
|
|
|
group: "{{ activate_file_group }}"
|
|
|
|
mode: "{{ activate_file_mode }}"
|
2015-11-20 22:09:34 +08:00
|
|
|
changed_when: false
|
2015-11-17 23:10:02 +08:00
|
|
|
with_items:
|
|
|
|
- done
|
|
|
|
- upstart
|
2016-05-06 02:56:32 +08:00
|
|
|
when: not use_systemd
|
2015-03-26 22:43:54 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: start and add that the monitor service to the init sequence (ubuntu)
|
2016-03-29 21:37:31 +08:00
|
|
|
command: initctl emit ceph-mon cluster={{ cluster }} id={{ monitor_name }}
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2016-05-06 02:56:32 +08:00
|
|
|
when: not use_systemd
|
2015-03-26 22:43:54 +08:00
|
|
|
|
2015-07-01 00:43:43 +08:00
|
|
|
# NOTE (leseb): somehow the service ansible module is messing things up
|
|
|
|
# as a safety measure we run the raw command
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: start and add that the monitor service to the init sequence
|
2015-07-01 00:43:43 +08:00
|
|
|
command: service ceph start mon
|
2015-07-04 02:18:41 +08:00
|
|
|
changed_when: false
|
2015-11-21 05:34:29 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_distribution != "Ubuntu"
|
|
|
|
- is_before_infernalis
|
2015-11-21 05:34:29 +08:00
|
|
|
|
2016-05-09 06:41:44 +08:00
|
|
|
- name: start and add that the monitor service to the init sequence (for or after infernalis)
|
|
|
|
command: systemctl enable ceph-mon@{{ monitor_name }}
|
2016-01-13 04:12:40 +08:00
|
|
|
changed_when: false
|
2016-01-13 04:41:51 +08:00
|
|
|
failed_when: false
|
2016-01-13 04:12:40 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- use_systemd
|
|
|
|
- is_after_hammer
|
2016-01-13 04:12:40 +08:00
|
|
|
|
2016-05-09 06:41:44 +08:00
|
|
|
- name: start the monitor service (for or after infernalis)
|
2015-11-21 05:34:29 +08:00
|
|
|
service:
|
2016-06-09 21:35:57 +08:00
|
|
|
name: ceph-mon@{{ monitor_name }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2015-11-21 05:34:29 +08:00
|
|
|
changed_when: false
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- use_systemd
|
|
|
|
- is_after_hammer
|
2015-03-26 22:43:54 +08:00
|
|
|
|
2015-07-01 00:43:43 +08:00
|
|
|
- name: collect admin and bootstrap keys
|
2016-03-29 21:37:31 +08:00
|
|
|
command: ceph-create-keys --cluster {{ cluster }} --id {{ monitor_name }}
|
2015-07-01 00:43:43 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2016-02-25 21:57:50 +08:00
|
|
|
when: cephx
|