]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
iscsi: refact deprecated variables
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 2 Jul 2019 13:30:12 +0000 (15:30 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 3 Jul 2019 20:13:19 +0000 (22:13 +0200)
This commit moves some old variables into ceph-defaults so we can move
the `use_new_ceph_iscsi` fact in ceph-facts role in order.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
group_vars/all.yml.sample
group_vars/iscsigws.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-defaults/defaults/main.yml
roles/ceph-facts/tasks/facts.yml
roles/ceph-iscsi-gw/defaults/main.yml
roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml
roles/ceph-validate/tasks/check_iscsi.yml

index fd663afac48febe2de89568a4601d6e7e2de1c24..3edcdb17e79560c327945ce5f5d354c1fa29bc11 100644 (file)
@@ -751,6 +751,66 @@ dummy:
 #alertmanager_conf_dir: /etc/alertmanager
 
 
+##################################
+# DEPRECIATED iSCSI TARGET SETUP #
+##################################
+
+# WARNING #
+
+# The following values are depreciated. To setup targets, gateways, LUNs, and
+# clients you should use gwcli or dashboard. If the following values are set,
+# the old ceph-iscsi-config/ceph-iscsi-cli packages will be used.
+
+# Specify the iqn for ALL gateways. This iqn is shared across the gateways, so an iscsi
+# client sees the gateway group as a single storage subsystem.
+#gateway_iqn: ""
+
+# gateway_ip_list provides a list of the IP Addrresses - one per gateway - that will be used
+# as an iscsi target portal ip. The list must be comma separated - and the order determines
+# the sequence of TPG's within the iscsi target across each gateway. Once set, additional
+# gateways can be added, but the order must *not* be changed.
+#gateway_ip_list: 0.0.0.0
+
+# rbd_devices defines the images that should be created and exported from the iscsi gateways.
+# If the rbd does not exist, it will be created for you. In addition you may increase the
+# size of rbd's by changing the size parameter and rerunning the playbook. A size value lower
+# than the current size of the rbd is ignored.
+#
+# the 'host' parameter defines which of the gateway nodes should handle the physical
+# allocation/expansion or removal of the rbd
+# to remove an image, simply use a state of 'absent'. This will first check the rbd is not allocated
+# to any client, and the remove it from LIO and then delete the rbd image
+#
+# NB. this variable definition can be commented out to bypass LUN management
+#
+# Example:
+#
+#rbd_devices:
+#  - { pool: 'rbd', image: 'ansible1', size: '30G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible2', size: '15G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible3', size: '30G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible4', size: '50G', host: 'ceph-1', state: 'present' }
+#rbd_devices: {}
+
+# client_connections defines the client ACL's to restrict client access to specific LUNs
+# The settings are as follows;
+# - image_list is a comma separated list of rbd images of the form <pool name>.<rbd_image_name>
+# - chap supplies the user and password the client will use for authentication of the
+#   form <user>/<password>
+# - status shows the intended state of this client definition - 'present' or 'absent'
+#
+# NB. this definition can be commented out to skip client (nodeACL) management
+#
+# Example:
+#
+#client_connections:
+#  - { client: 'iqn.1994-05.com.redhat:rh7-iscsi-client', image_list: 'rbd.ansible1,rbd.ansible2', chap: 'rh7-iscsi-client/redhat', status: 'present' }
+#  - { client: 'iqn.1991-05.com.microsoft:w2k12r2', image_list: 'rbd.ansible4', chap: 'w2k12r2/microsoft_w2k12', status: 'absent' }
+
+#client_connections: {}
+
+
+
 ###############
 # DEPRECATION #
 ###############
index 1614f2cfc1e33c69ebd93bf0556c351dda85375a..6314ff52d28df6a5d8394682c6c658860911c938 100644 (file)
@@ -50,62 +50,3 @@ dummy:
 #ceph_rbd_target_api_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
 #ceph_rbd_target_api_docker_cpu_limit: 1
 
-
-##################################
-# DEPRECIATED iSCSI TARGET SETUP #
-##################################
-
-# WARNING #
-
-# The following values are depreciated. To setup targets, gateways, LUNs, and
-# clients you should use gwcli or dashboard. If the following values are set,
-# the old ceph-iscsi-config/ceph-iscsi-cli packages will be used.
-
-# Specify the iqn for ALL gateways. This iqn is shared across the gateways, so an iscsi
-# client sees the gateway group as a single storage subsystem.
-#gateway_iqn: ""
-
-# gateway_ip_list provides a list of the IP Addrresses - one per gateway - that will be used
-# as an iscsi target portal ip. The list must be comma separated - and the order determines
-# the sequence of TPG's within the iscsi target across each gateway. Once set, additional
-# gateways can be added, but the order must *not* be changed.
-#gateway_ip_list: 0.0.0.0
-
-# rbd_devices defines the images that should be created and exported from the iscsi gateways.
-# If the rbd does not exist, it will be created for you. In addition you may increase the
-# size of rbd's by changing the size parameter and rerunning the playbook. A size value lower
-# than the current size of the rbd is ignored.
-#
-# the 'host' parameter defines which of the gateway nodes should handle the physical
-# allocation/expansion or removal of the rbd
-# to remove an image, simply use a state of 'absent'. This will first check the rbd is not allocated
-# to any client, and the remove it from LIO and then delete the rbd image
-#
-# NB. this variable definition can be commented out to bypass LUN management
-#
-# Example:
-#
-#rbd_devices:
-#  - { pool: 'rbd', image: 'ansible1', size: '30G', host: 'ceph-1', state: 'present' }
-#  - { pool: 'rbd', image: 'ansible2', size: '15G', host: 'ceph-1', state: 'present' }
-#  - { pool: 'rbd', image: 'ansible3', size: '30G', host: 'ceph-1', state: 'present' }
-#  - { pool: 'rbd', image: 'ansible4', size: '50G', host: 'ceph-1', state: 'present' }
-#rbd_devices: {}
-
-# client_connections defines the client ACL's to restrict client access to specific LUNs
-# The settings are as follows;
-# - image_list is a comma separated list of rbd images of the form <pool name>.<rbd_image_name>
-# - chap supplies the user and password the client will use for authentication of the
-#   form <user>/<password>
-# - status shows the intended state of this client definition - 'present' or 'absent'
-#
-# NB. this definition can be commented out to skip client (nodeACL) management
-#
-# Example:
-#
-#client_connections:
-#  - { client: 'iqn.1994-05.com.redhat:rh7-iscsi-client', image_list: 'rbd.ansible1,rbd.ansible2', chap: 'rh7-iscsi-client/redhat', status: 'present' }
-#  - { client: 'iqn.1991-05.com.microsoft:w2k12r2', image_list: 'rbd.ansible4', chap: 'w2k12r2/microsoft_w2k12', status: 'absent' }
-
-#client_connections: {}
-
index a149ca744c94912654d3f3d1c6c39c0bed0e72e7..14a97663b103c2196bd495f8894ee02f40fcd2df 100644 (file)
@@ -751,6 +751,66 @@ ceph_docker_registry: "registry.access.redhat.com"
 #alertmanager_conf_dir: /etc/alertmanager
 
 
+##################################
+# DEPRECIATED iSCSI TARGET SETUP #
+##################################
+
+# WARNING #
+
+# The following values are depreciated. To setup targets, gateways, LUNs, and
+# clients you should use gwcli or dashboard. If the following values are set,
+# the old ceph-iscsi-config/ceph-iscsi-cli packages will be used.
+
+# Specify the iqn for ALL gateways. This iqn is shared across the gateways, so an iscsi
+# client sees the gateway group as a single storage subsystem.
+#gateway_iqn: ""
+
+# gateway_ip_list provides a list of the IP Addrresses - one per gateway - that will be used
+# as an iscsi target portal ip. The list must be comma separated - and the order determines
+# the sequence of TPG's within the iscsi target across each gateway. Once set, additional
+# gateways can be added, but the order must *not* be changed.
+#gateway_ip_list: 0.0.0.0
+
+# rbd_devices defines the images that should be created and exported from the iscsi gateways.
+# If the rbd does not exist, it will be created for you. In addition you may increase the
+# size of rbd's by changing the size parameter and rerunning the playbook. A size value lower
+# than the current size of the rbd is ignored.
+#
+# the 'host' parameter defines which of the gateway nodes should handle the physical
+# allocation/expansion or removal of the rbd
+# to remove an image, simply use a state of 'absent'. This will first check the rbd is not allocated
+# to any client, and the remove it from LIO and then delete the rbd image
+#
+# NB. this variable definition can be commented out to bypass LUN management
+#
+# Example:
+#
+#rbd_devices:
+#  - { pool: 'rbd', image: 'ansible1', size: '30G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible2', size: '15G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible3', size: '30G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible4', size: '50G', host: 'ceph-1', state: 'present' }
+#rbd_devices: {}
+
+# client_connections defines the client ACL's to restrict client access to specific LUNs
+# The settings are as follows;
+# - image_list is a comma separated list of rbd images of the form <pool name>.<rbd_image_name>
+# - chap supplies the user and password the client will use for authentication of the
+#   form <user>/<password>
+# - status shows the intended state of this client definition - 'present' or 'absent'
+#
+# NB. this definition can be commented out to skip client (nodeACL) management
+#
+# Example:
+#
+#client_connections:
+#  - { client: 'iqn.1994-05.com.redhat:rh7-iscsi-client', image_list: 'rbd.ansible1,rbd.ansible2', chap: 'rh7-iscsi-client/redhat', status: 'present' }
+#  - { client: 'iqn.1991-05.com.microsoft:w2k12r2', image_list: 'rbd.ansible4', chap: 'w2k12r2/microsoft_w2k12', status: 'absent' }
+
+#client_connections: {}
+
+
+
 ###############
 # DEPRECATION #
 ###############
index 4a68cc324d3a8e6c3ca98e9bc4df6833ab6fa4e8..cf936639d5989cb880eb6e111f10469f0feff688 100644 (file)
@@ -743,6 +743,66 @@ alertmanager_data_dir: /var/lib/alertmanager
 alertmanager_conf_dir: /etc/alertmanager
 
 
+##################################
+# DEPRECIATED iSCSI TARGET SETUP #
+##################################
+
+# WARNING #
+
+# The following values are depreciated. To setup targets, gateways, LUNs, and
+# clients you should use gwcli or dashboard. If the following values are set,
+# the old ceph-iscsi-config/ceph-iscsi-cli packages will be used.
+
+# Specify the iqn for ALL gateways. This iqn is shared across the gateways, so an iscsi
+# client sees the gateway group as a single storage subsystem.
+gateway_iqn: ""
+
+# gateway_ip_list provides a list of the IP Addrresses - one per gateway - that will be used
+# as an iscsi target portal ip. The list must be comma separated - and the order determines
+# the sequence of TPG's within the iscsi target across each gateway. Once set, additional
+# gateways can be added, but the order must *not* be changed.
+gateway_ip_list: 0.0.0.0
+
+# rbd_devices defines the images that should be created and exported from the iscsi gateways.
+# If the rbd does not exist, it will be created for you. In addition you may increase the
+# size of rbd's by changing the size parameter and rerunning the playbook. A size value lower
+# than the current size of the rbd is ignored.
+#
+# the 'host' parameter defines which of the gateway nodes should handle the physical
+# allocation/expansion or removal of the rbd
+# to remove an image, simply use a state of 'absent'. This will first check the rbd is not allocated
+# to any client, and the remove it from LIO and then delete the rbd image
+#
+# NB. this variable definition can be commented out to bypass LUN management
+#
+# Example:
+#
+#rbd_devices:
+#  - { pool: 'rbd', image: 'ansible1', size: '30G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible2', size: '15G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible3', size: '30G', host: 'ceph-1', state: 'present' }
+#  - { pool: 'rbd', image: 'ansible4', size: '50G', host: 'ceph-1', state: 'present' }
+rbd_devices: {}
+
+# client_connections defines the client ACL's to restrict client access to specific LUNs
+# The settings are as follows;
+# - image_list is a comma separated list of rbd images of the form <pool name>.<rbd_image_name>
+# - chap supplies the user and password the client will use for authentication of the
+#   form <user>/<password>
+# - status shows the intended state of this client definition - 'present' or 'absent'
+#
+# NB. this definition can be commented out to skip client (nodeACL) management
+#
+# Example:
+#
+#client_connections:
+#  - { client: 'iqn.1994-05.com.redhat:rh7-iscsi-client', image_list: 'rbd.ansible1,rbd.ansible2', chap: 'rh7-iscsi-client/redhat', status: 'present' }
+#  - { client: 'iqn.1991-05.com.microsoft:w2k12r2', image_list: 'rbd.ansible4', chap: 'w2k12r2/microsoft_w2k12', status: 'absent' }
+
+client_connections: {}
+
+
+
 ###############
 # DEPRECATION #
 ###############
index 1988b34120a9842bf44812ab712994379475f0ab..f787abdc7d8074e92675b4ded68a621ea358c4fa 100644 (file)
     - (groups.get(grafana_server_group_name, []) | length > 0 or groups.get(mgr_group_name, []) | length > 0)
     - ip_version == 'ipv6'
     - dashboard_enabled | bool
+
+- name: set_fact use_new_ceph_iscsi package or old ceph-iscsi-config/cli
+  set_fact:
+    use_new_ceph_iscsi: "{{ (gateway_ip_list  == '0.0.0.0' and gateway_iqn | length == 0 and client_connections | length == 0 and rbd_devices | length == 0) | bool | ternary(true, false) }}"
\ No newline at end of file
index e2944ed9eaee62e6f5c309261b6f2ca4f11d2aca..4c7ff98c835bef986616840c5e50a207f1b035e5 100644 (file)
@@ -41,62 +41,3 @@ ceph_rbd_target_gw_docker_cpu_limit: 1
 # RBD_TARGET_API resource limitation
 ceph_rbd_target_api_docker_memory_limit: "{{ ansible_memtotal_mb }}m"
 ceph_rbd_target_api_docker_cpu_limit: 1
-
-
-##################################
-# DEPRECIATED iSCSI TARGET SETUP #
-##################################
-
-# WARNING #
-
-# The following values are depreciated. To setup targets, gateways, LUNs, and
-# clients you should use gwcli or dashboard. If the following values are set,
-# the old ceph-iscsi-config/ceph-iscsi-cli packages will be used.
-
-# Specify the iqn for ALL gateways. This iqn is shared across the gateways, so an iscsi
-# client sees the gateway group as a single storage subsystem.
-gateway_iqn: ""
-
-# gateway_ip_list provides a list of the IP Addrresses - one per gateway - that will be used
-# as an iscsi target portal ip. The list must be comma separated - and the order determines
-# the sequence of TPG's within the iscsi target across each gateway. Once set, additional
-# gateways can be added, but the order must *not* be changed.
-gateway_ip_list: 0.0.0.0
-
-# rbd_devices defines the images that should be created and exported from the iscsi gateways.
-# If the rbd does not exist, it will be created for you. In addition you may increase the
-# size of rbd's by changing the size parameter and rerunning the playbook. A size value lower
-# than the current size of the rbd is ignored.
-#
-# the 'host' parameter defines which of the gateway nodes should handle the physical
-# allocation/expansion or removal of the rbd
-# to remove an image, simply use a state of 'absent'. This will first check the rbd is not allocated
-# to any client, and the remove it from LIO and then delete the rbd image
-#
-# NB. this variable definition can be commented out to bypass LUN management
-#
-# Example:
-#
-#rbd_devices:
-#  - { pool: 'rbd', image: 'ansible1', size: '30G', host: 'ceph-1', state: 'present' }
-#  - { pool: 'rbd', image: 'ansible2', size: '15G', host: 'ceph-1', state: 'present' }
-#  - { pool: 'rbd', image: 'ansible3', size: '30G', host: 'ceph-1', state: 'present' }
-#  - { pool: 'rbd', image: 'ansible4', size: '50G', host: 'ceph-1', state: 'present' }
-rbd_devices: {}
-
-# client_connections defines the client ACL's to restrict client access to specific LUNs
-# The settings are as follows;
-# - image_list is a comma separated list of rbd images of the form <pool name>.<rbd_image_name>
-# - chap supplies the user and password the client will use for authentication of the
-#   form <user>/<password>
-# - status shows the intended state of this client definition - 'present' or 'absent'
-#
-# NB. this definition can be commented out to skip client (nodeACL) management
-#
-# Example:
-#
-#client_connections:
-#  - { client: 'iqn.1994-05.com.redhat:rh7-iscsi-client', image_list: 'rbd.ansible1,rbd.ansible2', chap: 'rh7-iscsi-client/redhat', status: 'present' }
-#  - { client: 'iqn.1991-05.com.microsoft:w2k12r2', image_list: 'rbd.ansible4', chap: 'w2k12r2/microsoft_w2k12', status: 'absent' }
-
-client_connections: {}
index b9c00e48a2b01a5b3666734614cb47d0326568c2..7c604330ff2fecd422e598a35d34c394a88c28cf 100644 (file)
         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'
index 6233a3d347478e9e1c078bdfcd3359efa770bd08..0f7ff890bd0dbbb5fe40e213327ae43f72399b8d 100644 (file)
@@ -1,13 +1,9 @@
 ---
-- 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'"
+    - gateway_ip_list == '0.0.0.0'
     - not containerized_deployment | bool
     - not use_new_ceph_iscsi | bool
 
   fail:
     msg: "you must set a iqn for the iSCSI target"
   when:
-    - "gateway_iqn | default('') | length == 0"
+    - gateway_iqn | length == 0
     - not containerized_deployment | bool
     - not use_new_ceph_iscsi | bool
 
 - name: fail if unsupported chap configuration
   fail:
     msg: "Mixing clients with CHAP enabled and disabled is not supported."
-  with_items: "{{ client_connections | default({})  }}"
+  with_items: "{{ client_connections  }}"
   when:
     - item.status is defined
     - item.status == "present"