From 67ffac083d34cffa5257dd58c65a4b2c1673671c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 24 Jul 2019 10:10:18 +0200 Subject: [PATCH 1/6] 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 --- .../tasks/container/containerized.yml | 14 +------ .../ceph-iscsi-gw/tasks/container/systemd.yml | 14 +++++++ roles/ceph-mds/tasks/containerized.yml | 11 +----- roles/ceph-mds/tasks/systemd.yml | 10 +++++ roles/ceph-mgr/tasks/start_mgr.yml | 10 +---- roles/ceph-mgr/tasks/systemd.yml | 10 +++++ roles/ceph-mon/tasks/start_monitor.yml | 10 +---- roles/ceph-mon/tasks/systemd.yml | 10 +++++ roles/ceph-nfs/tasks/start_nfs.yml | 10 +---- roles/ceph-nfs/tasks/systemd.yml | 10 +++++ roles/ceph-osd/tasks/start_osds.yml | 39 ++++++------------- roles/ceph-osd/tasks/systemd.yml | 21 ++++++++++ .../container/start_docker_rbd_mirror.yml | 10 +---- .../tasks/container/systemd.yml | 10 +++++ .../tasks/container/start_docker_rgw.yml | 10 +---- roles/ceph-rgw/tasks/container/systemd.yml | 10 +++++ 16 files changed, 120 insertions(+), 89 deletions(-) create mode 100644 roles/ceph-iscsi-gw/tasks/container/systemd.yml create mode 100644 roles/ceph-mds/tasks/systemd.yml create mode 100644 roles/ceph-mgr/tasks/systemd.yml create mode 100644 roles/ceph-mon/tasks/systemd.yml create mode 100644 roles/ceph-nfs/tasks/systemd.yml create mode 100644 roles/ceph-osd/tasks/systemd.yml create mode 100644 roles/ceph-rbd-mirror/tasks/container/systemd.yml create mode 100644 roles/ceph-rgw/tasks/container/systemd.yml diff --git a/roles/ceph-iscsi-gw/tasks/container/containerized.yml b/roles/ceph-iscsi-gw/tasks/container/containerized.yml index 014edba72c..b5dc4e95d9 100644 --- a/roles/ceph-iscsi-gw/tasks/container/containerized.yml +++ b/roles/ceph-iscsi-gw/tasks/container/containerized.yml @@ -7,18 +7,8 @@ - rbd-target-api - rbd-target-gw -- name: generate systemd unit files for tcmu-runner, rbd-target-api and rbd-target-gw - 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 }} +- name: include_tasks systemd.yml + include_tasks: systemd.yml - name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers systemd: diff --git a/roles/ceph-iscsi-gw/tasks/container/systemd.yml b/roles/ceph-iscsi-gw/tasks/container/systemd.yml new file mode 100644 index 0000000000..6768716b05 --- /dev/null +++ b/roles/ceph-iscsi-gw/tasks/container/systemd.yml @@ -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 }} diff --git a/roles/ceph-mds/tasks/containerized.yml b/roles/ceph-mds/tasks/containerized.yml index c4e64402fc..e10725a46d 100644 --- a/roles/ceph-mds/tasks/containerized.yml +++ b/roles/ceph-mds/tasks/containerized.yml @@ -3,15 +3,8 @@ set_fact: container_exec_cmd: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}" -- 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 +- name: include_tasks systemd.yml + include_tasks: systemd.yml - name: systemd start mds container systemd: diff --git a/roles/ceph-mds/tasks/systemd.yml b/roles/ceph-mds/tasks/systemd.yml new file mode 100644 index 0000000000..74f4d35f88 --- /dev/null +++ b/roles/ceph-mds/tasks/systemd.yml @@ -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 diff --git a/roles/ceph-mgr/tasks/start_mgr.yml b/roles/ceph-mgr/tasks/start_mgr.yml index 3712152077..348a718dde 100644 --- a/roles/ceph-mgr/tasks/start_mgr.yml +++ b/roles/ceph-mgr/tasks/start_mgr.yml @@ -17,15 +17,9 @@ - ceph_mgr_systemd_overrides is defined - ansible_service_mgr == 'systemd' -- name: generate systemd unit file - template: - src: "{{ role_path }}/templates/ceph-mgr.service.j2" - dest: /etc/systemd/system/ceph-mgr@.service - owner: "root" - group: "root" - mode: "0644" +- name: include_tasks systemd.yml + include_tasks: systemd.yml when: containerized_deployment | bool - notify: restart ceph mgrs - name: systemd start mgr systemd: diff --git a/roles/ceph-mgr/tasks/systemd.yml b/roles/ceph-mgr/tasks/systemd.yml new file mode 100644 index 0000000000..dad9d74de2 --- /dev/null +++ b/roles/ceph-mgr/tasks/systemd.yml @@ -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 diff --git a/roles/ceph-mon/tasks/start_monitor.yml b/roles/ceph-mon/tasks/start_monitor.yml index 56ef730cf0..c6a4e74ea1 100644 --- a/roles/ceph-mon/tasks/start_monitor.yml +++ b/roles/ceph-mon/tasks/start_monitor.yml @@ -19,14 +19,8 @@ - ceph_mon_systemd_overrides is defined - ansible_service_mgr == 'systemd' -- name: generate systemd unit file for mon container - 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 +- name: include_tasks systemd.yml + include_tasks: systemd.yml when: containerized_deployment | bool - name: start the monitor service diff --git a/roles/ceph-mon/tasks/systemd.yml b/roles/ceph-mon/tasks/systemd.yml new file mode 100644 index 0000000000..e099ef29f8 --- /dev/null +++ b/roles/ceph-mon/tasks/systemd.yml @@ -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 diff --git a/roles/ceph-nfs/tasks/start_nfs.yml b/roles/ceph-nfs/tasks/start_nfs.yml index bf888f070f..331c993e8d 100644 --- a/roles/ceph-nfs/tasks/start_nfs.yml +++ b/roles/ceph-nfs/tasks/start_nfs.yml @@ -60,15 +60,9 @@ mode: "0644" when: ceph_nfs_dynamic_exports | bool -- name: generate systemd unit file - template: - src: "{{ role_path }}/templates/ceph-nfs.service.j2" - dest: /etc/systemd/system/ceph-nfs@.service - owner: "root" - group: "root" - mode: "0644" +- name: include_tasks systemd.yml + include_tasks: systemd.yml when: containerized_deployment | bool - notify: restart ceph nfss - name: systemd start nfs container systemd: diff --git a/roles/ceph-nfs/tasks/systemd.yml b/roles/ceph-nfs/tasks/systemd.yml new file mode 100644 index 0000000000..0a31857378 --- /dev/null +++ b/roles/ceph-nfs/tasks/systemd.yml @@ -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 \ No newline at end of file diff --git a/roles/ceph-osd/tasks/start_osds.yml b/roles/ceph-osd/tasks/start_osds.yml index b38b7071e0..46e83d6910 100644 --- a/roles/ceph-osd/tasks/start_osds.yml +++ b/roles/ceph-osd/tasks/start_osds.yml @@ -1,24 +1,13 @@ --- -- name: container specific tasks - when: containerized_deployment | bool - block: - - name: umount ceph disk (if on openstack) - mount: - name: /mnt - src: /dev/vdb - fstype: ext3 - state: unmounted - when: ceph_docker_on_openstack | bool - - - name: generate ceph osd docker run script - 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: umount ceph disk (if on openstack) + mount: + name: /mnt + src: /dev/vdb + fstype: ext3 + state: unmounted + when: + - ceph_docker_on_openstack | bool + - containerized_deployment | bool # this is for ceph-disk, the ceph-disk command is gone so we have to list /var/lib/ceph - name: get osd ids @@ -40,14 +29,8 @@ failed_when: false register: ceph_osd_ids -- name: generate systemd unit file - 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 +- name: include_tasks systemd.yml + include_tasks: systemd.yml when: containerized_deployment | bool - name: systemd start osd diff --git a/roles/ceph-osd/tasks/systemd.yml b/roles/ceph-osd/tasks/systemd.yml new file mode 100644 index 0000000000..4992e5ee47 --- /dev/null +++ b/roles/ceph-osd/tasks/systemd.yml @@ -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 diff --git a/roles/ceph-rbd-mirror/tasks/container/start_docker_rbd_mirror.yml b/roles/ceph-rbd-mirror/tasks/container/start_docker_rbd_mirror.yml index 36ded05cab..cebeccff42 100644 --- a/roles/ceph-rbd-mirror/tasks/container/start_docker_rbd_mirror.yml +++ b/roles/ceph-rbd-mirror/tasks/container/start_docker_rbd_mirror.yml @@ -1,13 +1,7 @@ --- # Use systemd to manage container on Atomic host -- name: generate systemd unit file - 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 +- name: include_tasks systemd.yml + include_tasks: systemd.yml - name: systemd start rbd mirror container systemd: diff --git a/roles/ceph-rbd-mirror/tasks/container/systemd.yml b/roles/ceph-rbd-mirror/tasks/container/systemd.yml new file mode 100644 index 0000000000..723c467de4 --- /dev/null +++ b/roles/ceph-rbd-mirror/tasks/container/systemd.yml @@ -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 diff --git a/roles/ceph-rgw/tasks/container/start_docker_rgw.yml b/roles/ceph-rgw/tasks/container/start_docker_rgw.yml index 0346b96876..7cb3702144 100644 --- a/roles/ceph-rgw/tasks/container/start_docker_rgw.yml +++ b/roles/ceph-rgw/tasks/container/start_docker_rgw.yml @@ -10,14 +10,8 @@ INST_PORT={{ item.radosgw_frontend_port }} with_items: "{{ rgw_instances }}" -- name: generate systemd unit file - 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 +- name: include_task systemd.yml + include_tasks: systemd.yml - name: systemd start rgw container systemd: diff --git a/roles/ceph-rgw/tasks/container/systemd.yml b/roles/ceph-rgw/tasks/container/systemd.yml new file mode 100644 index 0000000000..1a088792b4 --- /dev/null +++ b/roles/ceph-rgw/tasks/container/systemd.yml @@ -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 \ No newline at end of file From 64086898df496e81a823b0a264157c5a9ede5492 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 24 Jul 2019 10:39:47 +0200 Subject: [PATCH 2/6] upgrade: add an infra playbook to migrate systemd units to podman this commit adds a new playbook to force systemd units for containers to use podman instead of docker. This is needed in the rhel8 upgrade context so after the base OS is upgraded containers can be started using podman. Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/docker-to-podman.yml | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 infrastructure-playbooks/docker-to-podman.yml diff --git a/infrastructure-playbooks/docker-to-podman.yml b/infrastructure-playbooks/docker-to-podman.yml new file mode 100644 index 0000000000..70d890d817 --- /dev/null +++ b/infrastructure-playbooks/docker-to-podman.yml @@ -0,0 +1,109 @@ +- hosts: + - mons + - osds + - mdss + - rgws + - nfss + - rbdmirrors + - clients + - iscsigws + - mgrs + - grafana-server + + gather_facts: false + become: True + any_errors_fatal: true + + vars: + delegate_facts_host: True + + pre_tasks: + - import_tasks: "{{ playbook_dir }}/../raw_install_python.yml" + + tasks: + # pre-tasks for following import - + - name: gather facts + setup: + when: not delegate_facts_host | bool + + - name: gather and delegate facts + setup: + delegate_to: "{{ item }}" + delegate_facts: True + with_items: "{{ groups['all'] }}" + run_once: true + when: delegate_facts_host | bool + +- hosts: + - "{{ mon_group_name | default('mons') }}" + - "{{ osd_group_name | default('osds') }}" + - "{{ mds_group_name | default('mdss') }}" + - "{{ rgw_group_name | default('rgws') }}" + - "{{ nfs_group_name | default('nfss') }}" + - "{{ mgr_group_name | default('mgrs') }}" + - "{{ iscsi_gw_group_name | default('iscsigws') }}" + - "{{ rbdmirror_group_name | default('rbdmirrors') }}" + become: true + vars: + docker2podman: True + container_binary: podman + container_binding_name: podman + container_service_name: podman + container_package_name: podman + pre_tasks: + - import_role: + name: ceph-defaults + - import_role: + name: ceph-facts + + - name: get docker version + command: docker --version + changed_when: false + check_mode: no + register: ceph_docker_version + + - name: set_fact ceph_docker_version ceph_docker_version.stdout.split + set_fact: + ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}" + + + tasks: + - import_role: + name: ceph-mon + tasks_from: systemd.yml + when: inventory_hostname in groups.get(mon_group_name, []) + + - import_role: + name: ceph-iscsi-gw + tasks_from: container/systemd.yml + when: inventory_hostname in groups.get(iscsi_gw_group_name, []) + + - import_role: + name: ceph-mds + tasks_from: systemd.yml + when: inventory_hostname in groups.get(mds_group_name, []) + + - import_role: + name: ceph-mgr + tasks_from: systemd.yml + when: inventory_hostname in groups.get(mgr_group_name, []) + + - import_role: + name: ceph-nfs + tasks_from: systemd.yml + when: inventory_hostname in groups.get(nfs_group_name, []) + + - import_role: + name: ceph-osd + tasks_from: systemd.yml + when: inventory_hostname in groups.get(osd_group_name, []) + + - import_role: + name: ceph-rbd-mirror + tasks_from: container/systemd.yml + when: inventory_hostname in groups.get(rbdmirror_group_name, []) + + - import_role: + name: ceph-rgw + tasks_from: container/systemd.yml + when: inventory_hostname in groups.get(rgw_group_name, []) \ No newline at end of file From 889640cd10e917dc3d37219ae42f78bb8b466120 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 30 Sep 2019 09:21:41 +0200 Subject: [PATCH 3/6] iscsigw: refact tasks directory layout This commit moves containerized deployment related files to `./tasks/ directory. This is needed to make `docker-to-podman.yml` working since we use `tasks_from:` option. Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/docker-to-podman.yml | 2 +- roles/ceph-iscsi-gw/tasks/{container => }/containerized.yml | 0 roles/ceph-iscsi-gw/tasks/main.yml | 2 +- roles/ceph-iscsi-gw/tasks/{container => }/systemd.yml | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename roles/ceph-iscsi-gw/tasks/{container => }/containerized.yml (100%) rename roles/ceph-iscsi-gw/tasks/{container => }/systemd.yml (100%) diff --git a/infrastructure-playbooks/docker-to-podman.yml b/infrastructure-playbooks/docker-to-podman.yml index 70d890d817..f8f83cdf00 100644 --- a/infrastructure-playbooks/docker-to-podman.yml +++ b/infrastructure-playbooks/docker-to-podman.yml @@ -75,7 +75,7 @@ - import_role: name: ceph-iscsi-gw - tasks_from: container/systemd.yml + tasks_from: systemd.yml when: inventory_hostname in groups.get(iscsi_gw_group_name, []) - import_role: diff --git a/roles/ceph-iscsi-gw/tasks/container/containerized.yml b/roles/ceph-iscsi-gw/tasks/containerized.yml similarity index 100% rename from roles/ceph-iscsi-gw/tasks/container/containerized.yml rename to roles/ceph-iscsi-gw/tasks/containerized.yml diff --git a/roles/ceph-iscsi-gw/tasks/main.yml b/roles/ceph-iscsi-gw/tasks/main.yml index 3d8bee8544..05732a0dac 100644 --- a/roles/ceph-iscsi-gw/tasks/main.yml +++ b/roles/ceph-iscsi-gw/tasks/main.yml @@ -20,5 +20,5 @@ - not use_new_ceph_iscsi | bool - name: include containerized.yml - include_tasks: container/containerized.yml + include_tasks: containerized.yml when: containerized_deployment | bool diff --git a/roles/ceph-iscsi-gw/tasks/container/systemd.yml b/roles/ceph-iscsi-gw/tasks/systemd.yml similarity index 100% rename from roles/ceph-iscsi-gw/tasks/container/systemd.yml rename to roles/ceph-iscsi-gw/tasks/systemd.yml From b2cce94f19f65d954014c82c4c3378933c134f0f Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 30 Sep 2019 09:36:00 +0200 Subject: [PATCH 4/6] rbdmirror: refact tasks directory layout This commit moves containerized deployment related files to `./tasks/` directory. This is needed to make `docker-to-podman.yml` working since we use `tasks_from:` option. Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/docker-to-podman.yml | 4 ++-- roles/ceph-rbd-mirror/tasks/container/main.yml | 3 --- roles/ceph-rbd-mirror/tasks/main.yml | 4 ++-- .../tasks/{container => }/start_docker_rbd_mirror.yml | 0 roles/ceph-rbd-mirror/tasks/{container => }/systemd.yml | 0 5 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 roles/ceph-rbd-mirror/tasks/container/main.yml rename roles/ceph-rbd-mirror/tasks/{container => }/start_docker_rbd_mirror.yml (100%) rename roles/ceph-rbd-mirror/tasks/{container => }/systemd.yml (100%) diff --git a/infrastructure-playbooks/docker-to-podman.yml b/infrastructure-playbooks/docker-to-podman.yml index f8f83cdf00..7908bb9604 100644 --- a/infrastructure-playbooks/docker-to-podman.yml +++ b/infrastructure-playbooks/docker-to-podman.yml @@ -100,10 +100,10 @@ - import_role: name: ceph-rbd-mirror - tasks_from: container/systemd.yml + tasks_from: systemd.yml when: inventory_hostname in groups.get(rbdmirror_group_name, []) - import_role: name: ceph-rgw tasks_from: container/systemd.yml - when: inventory_hostname in groups.get(rgw_group_name, []) \ No newline at end of file + when: inventory_hostname in groups.get(rgw_group_name, []) diff --git a/roles/ceph-rbd-mirror/tasks/container/main.yml b/roles/ceph-rbd-mirror/tasks/container/main.yml deleted file mode 100644 index 8c2e8a866e..0000000000 --- a/roles/ceph-rbd-mirror/tasks/container/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: include start_docker_rbd_mirror.yml - include_tasks: start_docker_rbd_mirror.yml diff --git a/roles/ceph-rbd-mirror/tasks/main.yml b/roles/ceph-rbd-mirror/tasks/main.yml index c7764cd8d5..6388567c25 100644 --- a/roles/ceph-rbd-mirror/tasks/main.yml +++ b/roles/ceph-rbd-mirror/tasks/main.yml @@ -18,8 +18,8 @@ set_fact: container_exec_cmd: "{{ container_binary }} exec ceph-rbd-mirror-{{ ansible_hostname }}" - - name: include container/main.yml - include_tasks: container/main.yml + - name: include start_docker_rbd_mirror.yml + include_tasks: start_docker_rbd_mirror.yml - name: include configure_mirroring.yml include_tasks: configure_mirroring.yml diff --git a/roles/ceph-rbd-mirror/tasks/container/start_docker_rbd_mirror.yml b/roles/ceph-rbd-mirror/tasks/start_docker_rbd_mirror.yml similarity index 100% rename from roles/ceph-rbd-mirror/tasks/container/start_docker_rbd_mirror.yml rename to roles/ceph-rbd-mirror/tasks/start_docker_rbd_mirror.yml diff --git a/roles/ceph-rbd-mirror/tasks/container/systemd.yml b/roles/ceph-rbd-mirror/tasks/systemd.yml similarity index 100% rename from roles/ceph-rbd-mirror/tasks/container/systemd.yml rename to roles/ceph-rbd-mirror/tasks/systemd.yml From f99a8d6b6459e5df8c76c2d9e2a50d72c0069b27 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 30 Sep 2019 09:40:56 +0200 Subject: [PATCH 5/6] rgw: refact tasks directory layout This commit moves containerized deployment related files to `./tasks/` directory. This is needed to make `docker-to-podman.yml` working since we use `tasks_from:` option. Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/docker-to-podman.yml | 2 +- roles/ceph-rgw/tasks/container/main.yml | 3 --- roles/ceph-rgw/tasks/main.yml | 4 ++-- roles/ceph-rgw/tasks/{container => }/start_docker_rgw.yml | 0 roles/ceph-rgw/tasks/{container => }/systemd.yml | 0 5 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 roles/ceph-rgw/tasks/container/main.yml rename roles/ceph-rgw/tasks/{container => }/start_docker_rgw.yml (100%) rename roles/ceph-rgw/tasks/{container => }/systemd.yml (100%) diff --git a/infrastructure-playbooks/docker-to-podman.yml b/infrastructure-playbooks/docker-to-podman.yml index 7908bb9604..861d957045 100644 --- a/infrastructure-playbooks/docker-to-podman.yml +++ b/infrastructure-playbooks/docker-to-podman.yml @@ -105,5 +105,5 @@ - import_role: name: ceph-rgw - tasks_from: container/systemd.yml + tasks_from: systemd.yml when: inventory_hostname in groups.get(rgw_group_name, []) diff --git a/roles/ceph-rgw/tasks/container/main.yml b/roles/ceph-rgw/tasks/container/main.yml deleted file mode 100644 index 539c42303e..0000000000 --- a/roles/ceph-rgw/tasks/container/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: include start_docker_rgw.yml - include_tasks: start_docker_rgw.yml diff --git a/roles/ceph-rgw/tasks/main.yml b/roles/ceph-rgw/tasks/main.yml index df0e8bc3ee..dad3c55042 100644 --- a/roles/ceph-rgw/tasks/main.yml +++ b/roles/ceph-rgw/tasks/main.yml @@ -14,8 +14,8 @@ include_tasks: start_radosgw.yml when: not containerized_deployment | bool -- name: include_tasks container/main.yml - include_tasks: container/main.yml +- name: include start_docker_rgw.yml + include_tasks: start_docker_rgw.yml when: containerized_deployment | bool - name: include_tasks multisite/main.yml diff --git a/roles/ceph-rgw/tasks/container/start_docker_rgw.yml b/roles/ceph-rgw/tasks/start_docker_rgw.yml similarity index 100% rename from roles/ceph-rgw/tasks/container/start_docker_rgw.yml rename to roles/ceph-rgw/tasks/start_docker_rgw.yml diff --git a/roles/ceph-rgw/tasks/container/systemd.yml b/roles/ceph-rgw/tasks/systemd.yml similarity index 100% rename from roles/ceph-rgw/tasks/container/systemd.yml rename to roles/ceph-rgw/tasks/systemd.yml From 3cae54b74f1586b698158af8b24d4c1be417ccd5 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 30 Sep 2019 11:02:52 +0200 Subject: [PATCH 6/6] rbdmirror: rename a file rename this file to be more generic. Signed-off-by: Guillaume Abrioux --- roles/ceph-rbd-mirror/tasks/main.yml | 4 ++-- ...t_docker_rbd_mirror.yml => start_container_rbd_mirror.yml} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename roles/ceph-rbd-mirror/tasks/{start_docker_rbd_mirror.yml => start_container_rbd_mirror.yml} (100%) diff --git a/roles/ceph-rbd-mirror/tasks/main.yml b/roles/ceph-rbd-mirror/tasks/main.yml index 6388567c25..1544c17b70 100644 --- a/roles/ceph-rbd-mirror/tasks/main.yml +++ b/roles/ceph-rbd-mirror/tasks/main.yml @@ -18,8 +18,8 @@ set_fact: container_exec_cmd: "{{ container_binary }} exec ceph-rbd-mirror-{{ ansible_hostname }}" - - name: include start_docker_rbd_mirror.yml - include_tasks: start_docker_rbd_mirror.yml + - name: include start_container_rbd_mirror.yml + include_tasks: start_container_rbd_mirror.yml - name: include configure_mirroring.yml include_tasks: configure_mirroring.yml diff --git a/roles/ceph-rbd-mirror/tasks/start_docker_rbd_mirror.yml b/roles/ceph-rbd-mirror/tasks/start_container_rbd_mirror.yml similarity index 100% rename from roles/ceph-rbd-mirror/tasks/start_docker_rbd_mirror.yml rename to roles/ceph-rbd-mirror/tasks/start_container_rbd_mirror.yml