From: Guillaume Abrioux Date: Mon, 30 Sep 2019 07:40:56 +0000 (+0200) Subject: rgw: refact tasks directory layout X-Git-Tag: v5.0.0alpha1~82 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e08194dd677bd3312240d46765e40b3f4aa6fe33;p=ceph-ansible.git 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 --- diff --git a/infrastructure-playbooks/docker-to-podman.yml b/infrastructure-playbooks/docker-to-podman.yml index 7908bb960..861d95704 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 539c42303..000000000 --- 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/container/start_docker_rgw.yml b/roles/ceph-rgw/tasks/container/start_docker_rgw.yml deleted file mode 100644 index 7cb370214..000000000 --- a/roles/ceph-rgw/tasks/container/start_docker_rgw.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: generate environment file - copy: - dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/EnvironmentFile" - owner: "root" - group: "root" - mode: "0644" - content: | - INST_NAME={{ item.instance_name }} - INST_PORT={{ item.radosgw_frontend_port }} - with_items: "{{ rgw_instances }}" - -- name: include_task systemd.yml - include_tasks: systemd.yml - -- name: systemd start rgw container - systemd: - name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }} - state: started - enabled: yes - masked: no - daemon_reload: yes - with_items: "{{ rgw_instances }}" diff --git a/roles/ceph-rgw/tasks/container/systemd.yml b/roles/ceph-rgw/tasks/container/systemd.yml deleted file mode 100644 index 1a088792b..000000000 --- a/roles/ceph-rgw/tasks/container/systemd.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- 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 diff --git a/roles/ceph-rgw/tasks/main.yml b/roles/ceph-rgw/tasks/main.yml index df0e8bc3e..dad3c5504 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/start_docker_rgw.yml b/roles/ceph-rgw/tasks/start_docker_rgw.yml new file mode 100644 index 000000000..7cb370214 --- /dev/null +++ b/roles/ceph-rgw/tasks/start_docker_rgw.yml @@ -0,0 +1,23 @@ +--- +- name: generate environment file + copy: + dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/EnvironmentFile" + owner: "root" + group: "root" + mode: "0644" + content: | + INST_NAME={{ item.instance_name }} + INST_PORT={{ item.radosgw_frontend_port }} + with_items: "{{ rgw_instances }}" + +- name: include_task systemd.yml + include_tasks: systemd.yml + +- name: systemd start rgw container + systemd: + name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }} + state: started + enabled: yes + masked: no + daemon_reload: yes + with_items: "{{ rgw_instances }}" diff --git a/roles/ceph-rgw/tasks/systemd.yml b/roles/ceph-rgw/tasks/systemd.yml new file mode 100644 index 000000000..1a088792b --- /dev/null +++ b/roles/ceph-rgw/tasks/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