2015-07-28 21:44:52 +08:00
|
|
|
---
|
2016-03-21 16:42:46 +08:00
|
|
|
- name: populate kv_store with default ceph.conf
|
2018-07-09 21:50:52 +08:00
|
|
|
docker_container:
|
2016-03-21 16:42:46 +08:00
|
|
|
name: populate-kv-store
|
2017-02-09 22:16:39 +08:00
|
|
|
image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
2016-03-21 16:42:46 +08:00
|
|
|
command: populate_kvstore
|
2018-07-09 21:50:52 +08:00
|
|
|
network: host
|
2016-03-21 16:42:46 +08:00
|
|
|
env:
|
|
|
|
KV_TYPE: "{{kv_type}}"
|
|
|
|
KV_IP: "{{kv_endpoint}}"
|
|
|
|
KV_PORT: "{{kv_port}}"
|
|
|
|
run_once: true
|
2016-03-22 23:58:20 +08:00
|
|
|
when:
|
2017-03-24 14:40:15 +08:00
|
|
|
- "{{ inventory_hostname == groups[mon_group_name][0] }}"
|
2017-04-13 01:57:33 +08:00
|
|
|
- containerized_deployment_with_kv
|
2016-05-09 22:08:33 +08:00
|
|
|
- mon_containerized_default_ceph_conf_with_kv
|
2016-03-21 16:42:46 +08:00
|
|
|
|
|
|
|
- name: populate kv_store with custom ceph.conf
|
2018-07-09 21:50:52 +08:00
|
|
|
docker_container:
|
2016-03-16 00:32:17 +08:00
|
|
|
name: populate-kv-store
|
2017-02-09 22:16:39 +08:00
|
|
|
image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
2016-03-16 00:32:17 +08:00
|
|
|
command: populate_kvstore
|
2018-07-09 21:50:52 +08:00
|
|
|
network: host
|
2016-03-16 00:32:17 +08:00
|
|
|
env:
|
|
|
|
KV_TYPE: "{{kv_type}}"
|
|
|
|
KV_IP: "{{kv_endpoint}}"
|
|
|
|
KV_PORT: "{{kv_port}}"
|
|
|
|
volumes:
|
2016-08-23 18:03:05 +08:00
|
|
|
- /etc/ceph/"{{ cluster }}".conf:/etc/ceph/ceph.defaults
|
2016-03-16 00:32:17 +08:00
|
|
|
run_once: true
|
2016-03-22 23:58:20 +08:00
|
|
|
when:
|
2017-03-24 14:40:15 +08:00
|
|
|
- "{{ inventory_hostname == groups[mon_group_name][0] }}"
|
2017-04-13 01:57:33 +08:00
|
|
|
- containerized_deployment_with_kv
|
2016-05-09 22:08:33 +08:00
|
|
|
- not mon_containerized_default_ceph_conf_with_kv
|
2016-03-16 00:32:17 +08:00
|
|
|
|
|
|
|
- name: delete populate-kv-store docker
|
2018-07-09 21:50:52 +08:00
|
|
|
docker_container:
|
2016-03-16 00:32:17 +08:00
|
|
|
name: populate-kv-store
|
|
|
|
state: absent
|
2017-02-09 22:16:39 +08:00
|
|
|
image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
2017-04-13 01:57:33 +08:00
|
|
|
when: containerized_deployment_with_kv
|
2016-03-16 00:32:17 +08:00
|
|
|
|
2016-01-28 03:50:05 +08:00
|
|
|
- name: generate systemd unit file
|
2016-03-22 23:58:20 +08:00
|
|
|
become: true
|
2016-02-10 03:49:22 +08:00
|
|
|
template:
|
2016-06-02 16:52:23 +08:00
|
|
|
src: "{{ role_path }}/templates/ceph-mon.service.j2"
|
2016-06-28 19:58:26 +08:00
|
|
|
dest: /etc/systemd/system/ceph-mon@.service
|
2016-01-28 03:50:05 +08:00
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
2018-01-08 22:00:32 +08:00
|
|
|
notify:
|
|
|
|
- restart ceph mons
|
2016-03-16 00:32:17 +08:00
|
|
|
|
2016-01-28 03:50:05 +08:00
|
|
|
- name: systemd start mon container
|
2017-09-29 20:54:00 +08:00
|
|
|
systemd:
|
2016-01-28 03:50:05 +08:00
|
|
|
name: ceph-mon@{{ ansible_hostname }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2018-06-28 15:53:03 +08:00
|
|
|
daemon_reload: yes
|