2016-04-04 06:35:09 +08:00
|
|
|
---
|
2022-05-12 23:22:54 +08:00
|
|
|
- name: non-containerized related tasks
|
|
|
|
when:
|
|
|
|
- not containerized_deployment | bool
|
|
|
|
- ceph_rbd_mirror_remote_user is defined
|
|
|
|
block:
|
|
|
|
- name: install dependencies
|
|
|
|
package:
|
|
|
|
name: rbd-mirror
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
tags: package-install
|
2016-07-12 18:15:22 +08:00
|
|
|
|
2022-05-12 23:22:54 +08:00
|
|
|
- name: ensure systemd service override directory exists
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "/etc/systemd/system/ceph-rbd-mirror@.service.d/"
|
|
|
|
when:
|
|
|
|
- ceph_rbd_mirror_systemd_overrides is defined
|
|
|
|
- ansible_facts['service_mgr'] == 'systemd'
|
2018-12-10 22:30:48 +08:00
|
|
|
|
2022-05-12 23:22:54 +08:00
|
|
|
- name: add ceph-rbd-mirror systemd service overrides
|
|
|
|
openstack.config_template.config_template:
|
|
|
|
src: "ceph-rbd-mirror.service.d-overrides.j2"
|
|
|
|
dest: "/etc/systemd/system/ceph-rbd-mirror@.service.d/ceph-rbd-mirror-systemd-overrides.conf"
|
|
|
|
config_overrides: "{{ ceph_rbd_mirror_systemd_overrides | default({}) }}"
|
|
|
|
config_type: "ini"
|
|
|
|
when:
|
|
|
|
- ceph_rbd_mirror_systemd_overrides is defined
|
|
|
|
- ansible_facts['service_mgr'] == 'systemd'
|
2016-07-12 18:15:22 +08:00
|
|
|
|
2022-05-12 23:22:54 +08:00
|
|
|
- name: enable ceph-rbd-mirror.target
|
|
|
|
systemd:
|
|
|
|
name: "ceph-rbd-mirror.target"
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
masked: no
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: set_fact ceph_cmd
|
|
|
|
set_fact:
|
|
|
|
rbd_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph:/var/lib/ceph:z -v /var/run/ceph:/var/run/ceph:z --entrypoint=rbd ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'rbd' }}"
|
2019-04-24 17:19:04 +08:00
|
|
|
|
2022-09-27 22:53:24 +08:00
|
|
|
- name: include configure_mirroring.yml
|
|
|
|
include_tasks: configure_mirroring.yml
|
|
|
|
|
2022-05-12 23:22:54 +08:00
|
|
|
- name: include start_container_rbd_mirror.yml
|
|
|
|
include_tasks: start_container_rbd_mirror.yml
|
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|
|
|
|
- ceph_rbd_mirror_remote_user is defined
|