2016-04-04 06:35:09 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Non-containerized related tasks
|
2022-05-12 23:22:54 +08:00
|
|
|
when:
|
|
|
|
- not containerized_deployment | bool
|
|
|
|
- ceph_rbd_mirror_remote_user is defined
|
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
ansible.builtin.package:
|
2022-05-12 23:22:54 +08:00
|
|
|
name: rbd-mirror
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
tags: package-install
|
2016-07-12 18:15:22 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Ensure systemd service override directory exists
|
|
|
|
ansible.builtin.file:
|
2022-05-12 23:22:54 +08:00
|
|
|
state: directory
|
|
|
|
path: "/etc/systemd/system/ceph-rbd-mirror@.service.d/"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0755"
|
2022-05-12 23:22:54 +08:00
|
|
|
when:
|
|
|
|
- ceph_rbd_mirror_systemd_overrides is defined
|
|
|
|
- ansible_facts['service_mgr'] == 'systemd'
|
2018-12-10 22:30:48 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Add ceph-rbd-mirror systemd service overrides
|
2022-05-12 23:22:54 +08:00
|
|
|
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
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Enable ceph-rbd-mirror.target
|
|
|
|
ansible.builtin.systemd:
|
2022-05-12 23:22:54 +08:00
|
|
|
name: "ceph-rbd-mirror.target"
|
|
|
|
state: started
|
2024-02-14 18:14:02 +08:00
|
|
|
enabled: true
|
|
|
|
masked: false
|
2022-05-12 23:22:54 +08:00
|
|
|
changed_when: false
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set_fact ceph_cmd
|
|
|
|
ansible.builtin.set_fact:
|
2022-05-12 23:22:54 +08:00
|
|
|
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
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include configure_mirroring.yml
|
|
|
|
ansible.builtin.include_tasks: configure_mirroring.yml
|
2022-09-27 22:53:24 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include start_container_rbd_mirror.yml
|
|
|
|
ansible.builtin.include_tasks: start_container_rbd_mirror.yml
|
2022-05-12 23:22:54 +08:00
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|
|
|
|
- ceph_rbd_mirror_remote_user is defined
|