]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
igw: Support ceph-iscsi package for install
authorMike Christie <mchristi@redhat.com>
Thu, 30 May 2019 16:28:34 +0000 (11:28 -0500)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 4 Jul 2019 00:04:04 +0000 (00:04 +0000)
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 <mchristi@redhat.com>
(cherry picked from commit cbe66cec5239504f5532bfac09fcc0a295b22271)

roles/ceph-iscsi-gw/tasks/main.yml
roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml
roles/ceph-validate/tasks/check_iscsi.yml

index c8364208fe714a016768ce82802eed70d13869a0..3d8bee8544c7863ff79b41babd4190b678fc2d0f 100644 (file)
@@ -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
index 4fd2b65e23919cc460090515f7b039dc41592e2a..b9c00e48a2b01a5b3666734614cb47d0326568c2 100644 (file)
@@ -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
         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:
index 1bdd45078c8c4f7af59d67e34fa09f48a88493fb..b067b6259aac7a1c7deebfe9673287b804a95d61 100644 (file)
@@ -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: