From: Guillaume Abrioux Date: Mon, 30 Sep 2019 07:21:41 +0000 (+0200) Subject: iscsigw: refact tasks directory layout X-Git-Tag: v5.0.0alpha1~84 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4636f3f7e29267398495dc37db2fa511dae6596b;p=ceph-ansible.git 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 --- diff --git a/infrastructure-playbooks/docker-to-podman.yml b/infrastructure-playbooks/docker-to-podman.yml index 70d890d81..f8f83cdf0 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/container/containerized.yml deleted file mode 100644 index b5dc4e95d..000000000 --- a/roles/ceph-iscsi-gw/tasks/container/containerized.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: create rbd target log directories - file: - path: '/var/log/{{ item }}' - state: directory - with_items: - - rbd-target-api - - rbd-target-gw - -- name: include_tasks systemd.yml - include_tasks: systemd.yml - -- name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers - systemd: - name: "{{ item }}" - state: started - enabled: yes - masked: no - daemon_reload: yes - with_items: - - tcmu-runner - - rbd-target-gw - - rbd-target-api diff --git a/roles/ceph-iscsi-gw/tasks/container/systemd.yml b/roles/ceph-iscsi-gw/tasks/container/systemd.yml deleted file mode 100644 index 6768716b0..000000000 --- a/roles/ceph-iscsi-gw/tasks/container/systemd.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- 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-iscsi-gw/tasks/containerized.yml b/roles/ceph-iscsi-gw/tasks/containerized.yml new file mode 100644 index 000000000..b5dc4e95d --- /dev/null +++ b/roles/ceph-iscsi-gw/tasks/containerized.yml @@ -0,0 +1,23 @@ +--- +- name: create rbd target log directories + file: + path: '/var/log/{{ item }}' + state: directory + with_items: + - rbd-target-api + - rbd-target-gw + +- name: include_tasks systemd.yml + include_tasks: systemd.yml + +- name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers + systemd: + name: "{{ item }}" + state: started + enabled: yes + masked: no + daemon_reload: yes + with_items: + - tcmu-runner + - rbd-target-gw + - rbd-target-api diff --git a/roles/ceph-iscsi-gw/tasks/main.yml b/roles/ceph-iscsi-gw/tasks/main.yml index 3d8bee854..05732a0da 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/systemd.yml b/roles/ceph-iscsi-gw/tasks/systemd.yml new file mode 100644 index 000000000..6768716b0 --- /dev/null +++ b/roles/ceph-iscsi-gw/tasks/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 }}