From 6872f7ee9570c4e9bcd01b0f15c981519e6bcdd2 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Thu, 30 May 2019 11:28:34 -0500 Subject: [PATCH] igw: Support ceph-iscsi package for install This adds support for the ceph-iscsi package during install. ceph-iscsi does not support setting up targets/gws, luns and clients with the current library/igw_* code. Going forward those tasks should be done with gwcli or dashboard. ceph-iscsi will only be used if the user has no iscsi objects setup so we do not break existing setups. The next patch will update the iscsigws.yml.sample to document that users must not setup any iscsi object if they want to use the new package and tools. Signed-off-by: Mike Christie (cherry picked from commit cbe66cec5239504f5532bfac09fcc0a295b22271) --- roles/ceph-iscsi-gw/tasks/main.yml | 4 +- .../tasks/non-container/prerequisites.yml | 43 ++++++++++++------- roles/ceph-validate/tasks/check_iscsi.yml | 5 +++ 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/roles/ceph-iscsi-gw/tasks/main.yml b/roles/ceph-iscsi-gw/tasks/main.yml index c8364208f..3d8bee854 100644 --- a/roles/ceph-iscsi-gw/tasks/main.yml +++ b/roles/ceph-iscsi-gw/tasks/main.yml @@ -15,7 +15,9 @@ - name: include non-container/configure_iscsi.yml include_tasks: non-container/configure_iscsi.yml - when: not containerized_deployment | bool + when: + - not containerized_deployment | bool + - not use_new_ceph_iscsi | bool - name: include containerized.yml include_tasks: container/containerized.yml diff --git a/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml b/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml index 4fd2b65e2..b9c00e48a 100644 --- a/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml +++ b/roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml @@ -2,21 +2,39 @@ - name: red hat based systems tasks when: ansible_os_family == 'RedHat' block: + - name: set_fact common pkgs and repos + set_fact: + common_pkgs: + - tcmu-runner + - targetcli + - python-rtslib + common_repos: + - tcmu-runner + - python-rtslib + - name: set_fact base iscsi pkgs if new style ceph-iscsi + set_fact: + iscsi_base: + - ceph-iscsi + when: use_new_ceph_iscsi | bool + - name: set_fact base iscsi pkgs if using older ceph-iscsi-config + set_fact: + iscsi_base: + - ceph-iscsi-cli + - ceph-iscsi-config + when: not use_new_ceph_iscsi | bool + - name: set_fact ceph_iscsi_repos + set_fact: + ceph_iscsi_repos: "{{ common_repos + iscsi_base }}" + - name: set_fact ceph_iscsi_pkgs + set_fact: + ceph_iscsi_pkgs: "{{ common_pkgs + iscsi_base }}" - name: when ceph_iscsi_config_dev is true when: - ceph_origin == 'repository' - ceph_repository == 'dev' - ceph_iscsi_config_dev | bool block: - - name: set_fact ceph_iscsi_repos - set_fact: - ceph_iscsi_repos: - - ceph-iscsi-config - - tcmu-runner - - python-rtslib - - ceph-iscsi-cli - - - name: fetch ceph-iscsi-config development repository + - name: fetch ceph-iscsi development repository uri: url: https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo return_content: yes @@ -40,12 +58,7 @@ state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" register: result until: result is succeeded - with_items: - - tcmu-runner - - ceph-iscsi-config - - targetcli - - python-rtslib - - ceph-iscsi-cli + with_items: "{{ ceph_iscsi_pkgs }}" - name: check the status of the target.service override stat: diff --git a/roles/ceph-validate/tasks/check_iscsi.yml b/roles/ceph-validate/tasks/check_iscsi.yml index 1bdd45078..b067b6259 100644 --- a/roles/ceph-validate/tasks/check_iscsi.yml +++ b/roles/ceph-validate/tasks/check_iscsi.yml @@ -1,10 +1,15 @@ --- +- name: set_fact use_new_ceph_iscsi package or old ceph-iscsi-config/cli + set_fact: + use_new_ceph_iscsi: "{{ (gateway_ip_list | default('0.0.0.0') == '0.0.0.0' and gateway_iqn | default('') | length == 0 and client_connections | default({}) | length == 0 and rbd_devices | default({}) | length == 0) | bool | ternary(true, false) }}" + - name: make sure gateway_ip_list is configured fail: msg: "you must set a list of IPs (comma separated) for gateway_ip_list" when: - "gateway_ip_list | default('0.0.0.0') == '0.0.0.0'" - not containerized_deployment | bool + - not use_new_ceph_iscsi | bool - name: fail if unsupported chap configuration fail: -- 2.39.5