mirror of https://github.com/ceph/ceph-ansible.git
container: isolate systemd tasks
This commit isolates the systemd unit files generation for containers into
separate yml files in order to be able importing each corresponding roles
without playing all tasks.
This is needed so we can run ceph-ansible to render systemd unit files
so they call podman instead of docker.
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit bd64167469
)
pull/4509/head
parent
7bb835240e
commit
df5337535d
|
@ -7,18 +7,8 @@
|
||||||
- rbd-target-api
|
- rbd-target-api
|
||||||
- rbd-target-gw
|
- rbd-target-gw
|
||||||
|
|
||||||
- name: generate systemd unit files for tcmu-runner, rbd-target-api and rbd-target-gw
|
- name: include_tasks systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/{{ item }}.service.j2"
|
|
||||||
dest: /etc/systemd/system/{{ item }}.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
with_items:
|
|
||||||
- tcmu-runner
|
|
||||||
- rbd-target-gw
|
|
||||||
- rbd-target-api
|
|
||||||
notify: restart ceph {{ item }}
|
|
||||||
|
|
||||||
- name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers
|
- name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit files for tcmu-runner, rbd-target-api and rbd-target-gw
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/{{ item }}.service.j2"
|
||||||
|
dest: /etc/systemd/system/{{ item }}.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
with_items:
|
||||||
|
- tcmu-runner
|
||||||
|
- rbd-target-gw
|
||||||
|
- rbd-target-api
|
||||||
|
notify: restart ceph {{ item }}
|
|
@ -3,15 +3,8 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
container_exec_cmd: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
|
container_exec_cmd: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
|
||||||
|
|
||||||
- name: generate systemd unit file
|
- name: include_tasks systemd.yml
|
||||||
become: true
|
include_tasks: systemd.yml
|
||||||
template:
|
|
||||||
src: "{{ role_path }}/templates/ceph-mds.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-mds@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
notify: restart ceph mdss
|
|
||||||
|
|
||||||
- name: systemd start mds container
|
- name: systemd start mds container
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-mds.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-mds@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph mdss
|
|
@ -17,15 +17,9 @@
|
||||||
- ceph_mgr_systemd_overrides is defined
|
- ceph_mgr_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: generate systemd unit file
|
- name: include_tasks systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/ceph-mgr.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-mgr@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
notify: restart ceph mgrs
|
|
||||||
|
|
||||||
- name: systemd start mgr
|
- name: systemd start mgr
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-mgr.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-mgr@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph mgrs
|
|
@ -19,14 +19,8 @@
|
||||||
- ceph_mon_systemd_overrides is defined
|
- ceph_mon_systemd_overrides is defined
|
||||||
- ansible_service_mgr == 'systemd'
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: generate systemd unit file for mon container
|
- name: include_tasks systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/ceph-mon.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-mon@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
notify: restart ceph mons
|
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: start the monitor service
|
- name: start the monitor service
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit file for mon container
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-mon.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-mon@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph mons
|
|
@ -60,15 +60,9 @@
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
when: ceph_nfs_dynamic_exports | bool
|
when: ceph_nfs_dynamic_exports | bool
|
||||||
|
|
||||||
- name: generate systemd unit file
|
- name: include_tasks systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/ceph-nfs.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-nfs@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
notify: restart ceph nfss
|
|
||||||
|
|
||||||
- name: systemd start nfs container
|
- name: systemd start nfs container
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-nfs.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-nfs@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph nfss
|
|
@ -1,24 +1,13 @@
|
||||||
---
|
---
|
||||||
- name: container specific tasks
|
|
||||||
when: containerized_deployment | bool
|
|
||||||
block:
|
|
||||||
- name: umount ceph disk (if on openstack)
|
- name: umount ceph disk (if on openstack)
|
||||||
mount:
|
mount:
|
||||||
name: /mnt
|
name: /mnt
|
||||||
src: /dev/vdb
|
src: /dev/vdb
|
||||||
fstype: ext3
|
fstype: ext3
|
||||||
state: unmounted
|
state: unmounted
|
||||||
when: ceph_docker_on_openstack | bool
|
when:
|
||||||
|
- ceph_docker_on_openstack | bool
|
||||||
- name: generate ceph osd docker run script
|
- containerized_deployment | bool
|
||||||
template:
|
|
||||||
src: "{{ role_path }}/templates/ceph-osd-run.sh.j2"
|
|
||||||
dest: "{{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh"
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0744"
|
|
||||||
setype: "bin_t"
|
|
||||||
notify: restart ceph osds
|
|
||||||
|
|
||||||
# this is for ceph-disk, the ceph-disk command is gone so we have to list /var/lib/ceph
|
# this is for ceph-disk, the ceph-disk command is gone so we have to list /var/lib/ceph
|
||||||
- name: get osd ids
|
- name: get osd ids
|
||||||
|
@ -40,14 +29,8 @@
|
||||||
failed_when: false
|
failed_when: false
|
||||||
register: ceph_osd_ids
|
register: ceph_osd_ids
|
||||||
|
|
||||||
- name: generate systemd unit file
|
- name: include_tasks systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/ceph-osd.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-osd@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
notify: restart ceph osds
|
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: systemd start osd
|
- name: systemd start osd
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
---
|
||||||
|
- name: generate ceph osd docker run script
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-osd-run.sh.j2"
|
||||||
|
dest: "{{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh"
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0744"
|
||||||
|
setype: "bin_t"
|
||||||
|
notify: restart ceph osds
|
||||||
|
|
||||||
|
- name: generate systemd unit file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-osd.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-osd@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph osds
|
|
@ -1,13 +1,7 @@
|
||||||
---
|
---
|
||||||
# Use systemd to manage container on Atomic host
|
# Use systemd to manage container on Atomic host
|
||||||
- name: generate systemd unit file
|
- name: include_tasks systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/ceph-rbd-mirror.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-rbd-mirror@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
notify: restart ceph rbdmirrors
|
|
||||||
|
|
||||||
- name: systemd start rbd mirror container
|
- name: systemd start rbd mirror container
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-rbd-mirror.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-rbd-mirror@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph rbdmirrors
|
|
@ -10,14 +10,8 @@
|
||||||
INST_PORT={{ item.radosgw_frontend_port }}
|
INST_PORT={{ item.radosgw_frontend_port }}
|
||||||
with_items: "{{ rgw_instances }}"
|
with_items: "{{ rgw_instances }}"
|
||||||
|
|
||||||
- name: generate systemd unit file
|
- name: include_task systemd.yml
|
||||||
template:
|
include_tasks: systemd.yml
|
||||||
src: "{{ role_path }}/templates/ceph-radosgw.service.j2"
|
|
||||||
dest: /etc/systemd/system/ceph-radosgw@.service
|
|
||||||
owner: "root"
|
|
||||||
group: "root"
|
|
||||||
mode: "0644"
|
|
||||||
notify: restart ceph rgws
|
|
||||||
|
|
||||||
- name: systemd start rgw container
|
- name: systemd start rgw container
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: generate systemd unit file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: "{{ role_path }}/templates/ceph-radosgw.service.j2"
|
||||||
|
dest: /etc/systemd/system/ceph-radosgw@.service
|
||||||
|
owner: "root"
|
||||||
|
group: "root"
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart ceph rgws
|
Loading…
Reference in New Issue