ceph-ansible/roles/ceph-rbd-mirror/tasks/main.yml

54 lines
2.0 KiB
YAML
Raw Normal View History

---
- name: Non-containerized related tasks
when:
- not containerized_deployment | bool
- ceph_rbd_mirror_remote_user is defined
block:
- name: Install dependencies
ansible.builtin.package:
name: rbd-mirror
state: present
register: result
until: result is succeeded
tags: package-install
- name: Ensure systemd service override directory exists
ansible.builtin.file:
state: directory
path: "/etc/systemd/system/ceph-rbd-mirror@.service.d/"
mode: "0755"
when:
- ceph_rbd_mirror_systemd_overrides is defined
- ansible_facts['service_mgr'] == 'systemd'
- 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'
- name: Enable ceph-rbd-mirror.target
ansible.builtin.systemd:
name: "ceph-rbd-mirror.target"
state: started
enabled: true
masked: false
changed_when: false
- name: Set_fact ceph_cmd
ansible.builtin.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' }}"
- name: Include configure_mirroring.yml
ansible.builtin.include_tasks: configure_mirroring.yml
- name: Include start_container_rbd_mirror.yml
ansible.builtin.include_tasks: start_container_rbd_mirror.yml
when:
- containerized_deployment | bool
- ceph_rbd_mirror_remote_user is defined