- name: remove ceph mds service
file:
- path: /etc/systemd/system/ceph-mds@.service
+ path: /etc/systemd/system/ceph-mds{{ item }}
state: absent
+ loop:
+ - '@.service'
+ - '.target'
- name: purge ceph mgr cluster
- name: remove ceph mgr service
file:
- path: /etc/systemd/system/ceph-mgr@.service
+ path: /etc/systemd/system/ceph-mgr{{ item }}
state: absent
-
+ loop:
+ - '@.service'
+ - '.target'
- name: purge rgwloadbalancer cluster
hosts: rgwloadbalancers
failed_when: false
with_items: "{{ rgw_instances }}"
+ - name: remove ceph rgw service
+ file:
+ path: /etc/systemd/system/ceph-radosgw{{ item }}
+ state: absent
+ loop:
+ - '@.service'
+ - '.target'
+
- name: purge ceph rbd-mirror cluster
hosts: rbdmirrors
enabled: no
failed_when: false
+ - name: remove ceph rbd-mirror service
+ file:
+ path: /etc/systemd/system/ceph-rbd-mirror{{ item }}
+ state: absent
+ loop:
+ - '@.service'
+ - '.target'
+
- name: purge ceph osd cluster
vars:
- name: remove ceph osd service
file:
- path: /etc/systemd/system/ceph-osd@.service
+ path: /etc/systemd/system/ceph-osd{{ item }}
state: absent
- when: containerized_deployment | bool
+ loop:
+ - '@.service'
+ - '.target'
- name: purge ceph mon cluster
hosts: mons
- name: remove ceph mon and mgr service
file:
- path: "/etc/systemd/system/ceph-{{ item }}@.service"
+ path: "/etc/systemd/system/ceph-{{ item.0 }}{{ item.1 }}"
state: absent
- with_items:
- - mon
- - mgr
+ loop: "{{ ['mon', 'mgr'] | product(['@.service', '.target']) | list }}"
- name: purge ceph-crash daemons
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph*@.service instances at once
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
---
+- name: generate systemd ceph-mon target file
+ copy:
+ src: ceph.target
+ dest: /etc/systemd/system/ceph.target
+
+- name: enable ceph.target
+ service:
+ name: ceph.target
+ enabled: yes
+ daemon_reload: yes
+
- name: include prerequisites.yml
include_tasks: prerequisites.yml
TimeoutStopSec=10
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mds@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
\ No newline at end of file
- name: include_tasks systemd.yml
include_tasks: systemd.yml
+- name: enable ceph-mds.target
+ service:
+ name: ceph-mds.target
+ enabled: yes
+ daemon_reload: yes
+ when: containerized_deployment | bool
+
- name: systemd start mds container
systemd:
name: ceph-mds@{{ ansible_facts['hostname'] }}
group: "root"
mode: "0644"
notify: restart ceph mdss
+
+- name: generate systemd ceph-mds target file
+ copy:
+ src: ceph-mds.target
+ dest: /etc/systemd/system/ceph-mds.target
+ when: containerized_deployment | bool
\ No newline at end of file
[Unit]
Description=Ceph MDS
+PartOf=ceph-mds.target
{% if container_binary == 'docker' %}
After=docker.service
Requires=docker.service
{% endif %}
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mgr@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
\ No newline at end of file
include_tasks: systemd.yml
when: containerized_deployment | bool
+- name: enable ceph-mgr.target
+ service:
+ name: ceph-mgr.target
+ enabled: yes
+ daemon_reload: yes
+ when: containerized_deployment | bool
+
- name: systemd start mgr
systemd:
name: ceph-mgr@{{ ansible_facts['hostname'] }}
group: "root"
mode: "0644"
notify: restart ceph mgrs
+
+- name: generate systemd ceph-mgr target file
+ copy:
+ src: ceph-mgr.target
+ dest: /etc/systemd/system/ceph-mgr.target
+ when: containerized_deployment | bool
\ No newline at end of file
[Unit]
Description=Ceph Manager
+PartOf=ceph-mgr.target
{% if container_binary == 'docker' %}
After=docker.service
Requires=docker.service
{% endif %}
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph-mon@.service instances at once
+PartOf=ceph.target
+Before=ceph.target
+Wants=ceph.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
\ No newline at end of file
group: "root"
mode: "0644"
notify: restart ceph mons
+
+- name: generate systemd ceph-mon target file
+ copy:
+ src: ceph-mon.target
+ dest: /etc/systemd/system/ceph-mon.target
+ when: containerized_deployment | bool
+
+- name: enable ceph-mon.target
+ service:
+ name: ceph-mon.target
+ enabled: yes
+ daemon_reload: yes
+ when: containerized_deployment | bool
\ No newline at end of file
[Unit]
Description=Ceph Monitor
+PartOf=ceph-mon.target
{% if container_binary == 'docker' %}
After=docker.service
Requires=docker.service
{% endif %}
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph-osd@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
\ No newline at end of file
group: "root"
mode: "0644"
notify: restart ceph osds
+
+- name: generate systemd ceph-osd target file
+ copy:
+ src: ceph-osd.target
+ dest: /etc/systemd/system/ceph-osd.target
+ when: containerized_deployment | bool
+
+- name: enable ceph-osd.target
+ service:
+ name: ceph-osd.target
+ enabled: yes
+ daemon_reload: yes
+ when: containerized_deployment | bool
\ No newline at end of file
# {{ ansible_managed }}
[Unit]
Description=Ceph OSD
+PartOf=ceph-osd.target
{% if container_binary == 'docker' %}
After=docker.service
Requires=docker.service
{% endif %}
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph-rbd-mirror@.service instances at once
+PartOf=ceph.target
+Before=ceph.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
\ No newline at end of file
group: "root"
mode: "0644"
notify: restart ceph rbdmirrors
+
+- name: generate systemd ceph-rbd-mirror target file
+ copy:
+ src: ceph-rbd-mirror.target
+ dest: /etc/systemd/system/ceph-rbd-mirror.target
+ when: containerized_deployment | bool
+
+- name: enable ceph-rbd-mirror.target
+ service:
+ name: ceph-rbd-mirror.target
+ enabled: yes
+ daemon_reload: yes
+ when: containerized_deployment | bool
\ No newline at end of file
[Unit]
Description=Ceph RBD mirror
+PartOf=ceph-rbd-mirror.target
{% if container_binary == 'docker' %}
After=docker.service
Requires=docker.service
{% endif %}
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target
--- /dev/null
+[Unit]
+Description=ceph target allowing to start/stop all ceph-radosgw@.service instances at once
+PartOf=ceph.target
+After=ceph-mon.target
+Before=ceph.target
+Wants=ceph.target ceph-mon.target
+
+[Install]
+WantedBy=multi-user.target ceph.target
\ No newline at end of file
owner: "root"
group: "root"
mode: "0644"
- notify: restart ceph rgws
\ No newline at end of file
+ notify: restart ceph rgws
+
+- name: generate systemd ceph-radosgw target file
+ copy:
+ src: ceph-radosgw.target
+ dest: /etc/systemd/system/ceph-radosgw.target
+ when: containerized_deployment | bool
+
+- name: enable ceph-radosgw.target
+ service:
+ name: ceph-radosgw.target
+ enabled: yes
+ daemon_reload: yes
+ when: containerized_deployment | bool
\ No newline at end of file
[Unit]
Description=Ceph RGW
+PartOf=ceph-radosgw.target
{% if container_binary == 'docker' %}
After=docker.service
Requires=docker.service
{% endif %}
[Install]
-WantedBy=multi-user.target
+WantedBy=ceph.target