]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
iscsi: re-enable the scenario 1931/head
authorSébastien Han <seb@redhat.com>
Thu, 21 Sep 2017 08:07:37 +0000 (10:07 +0200)
committerSébastien Han <seb@redhat.com>
Thu, 28 Sep 2017 16:46:28 +0000 (18:46 +0200)
CentOS 7.4 vagrant box is now available so re-enabling this scenario.
For more info:
https://seven.centos.org/2017/09/updated-centos-vagrant-images-available-v1708-01/

Signed-off-by: Sébastien Han <seb@redhat.com>
12 files changed:
group_vars/iscsi-gws.yml.sample
roles/ceph-common/tasks/installs/redhat_dev_repository.yml
roles/ceph-iscsi-gw/defaults/main.yml
roles/ceph-iscsi-gw/tasks/check_mandatory_vars.yml [new file with mode: 0644]
roles/ceph-iscsi-gw/tasks/configure_iscsi.yml
roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml
roles/ceph-iscsi-gw/tasks/main.yml
roles/ceph-iscsi-gw/tasks/prerequisites.yml
roles/ceph-iscsi-gw/templates/iscsi-gateway.cfg.j2
tests/functional/centos/7/cluster/group_vars/iscsi_gws [new file with mode: 0644]
tests/functional/centos/7/cluster/hosts
tests/functional/centos/7/cluster/vagrant_variables.yml

index e196e39cd47add0581fc28ef82d1ccef59fd220c..8751f42151d8c0d1e58177cbd611682e24f596e4 100644 (file)
@@ -17,7 +17,7 @@ dummy:
 # 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: "192.168.122.101,192.168.122.102,192.168.122.103"
+#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
@@ -30,11 +30,15 @@ dummy:
 # 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
@@ -45,7 +49,12 @@ dummy:
 # - 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 7aa053715d03bb854322b70c3a48fa4ffcfa1cb9..c8fd5bdc9a1cf15a29071de32d9a917a6d6f9520 100644 (file)
     - nfs_group_name in group_names
     - nfs_ganesha_dev
 
+- name: set_fact ceph_iscsi_repos
+  set_fact:
+    ceph_iscsi_repos:
+      - ceph-iscsi-config
+      - tcmu-runner
+  when:
+    - ceph_iscsi_config_dev
+    - iscsi_gw_group_name in group_names
+
 - name: fetch ceph-iscsi-config red hat development repository
   uri:
-    url: https://shaman.ceph.com/api/repos/ceph-iscsi-config/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo
+    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
   register: ceph_iscsi_config_dev_yum_repo
+  with_items: "{{ ceph_iscsi_repos }}"
   when:
     - ceph_iscsi_config_dev
     - iscsi_gw_group_name in group_names
 
 - name: configure ceph-iscsi-config red hat development repository
   copy:
-    content: "{{ ceph_iscsi_config_dev_yum_repo.content }}"
-    dest: /etc/yum.repos.d/ceph-iscsi-config-dev.repo
+    content: "{{ item.0.content }}"
+    dest: "/etc/yum.repos.d/{{ item.1 }}-dev.repo"
     owner: root
     group: root
     backup: yes
+  with_together:
+    - "{{ ceph_iscsi_config_dev_yum_repo.results }}"
+    - "{{ ceph_iscsi_repos }}"
   when:
     - ceph_iscsi_config_dev
     - iscsi_gw_group_name in group_names
index a67d864dd46060e2e481c6349dfc426bd66d2f63..4d7966aa129fcada5b74d1c537fc05c84b08eb8e 100644 (file)
@@ -9,7 +9,7 @@ gateway_iqn: "iqn.2003-01.com.redhat.iscsi-gw:ceph-igw"
 # 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: "192.168.122.101,192.168.122.102,192.168.122.103"
+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
@@ -22,11 +22,15 @@ gateway_ip_list: "192.168.122.101,192.168.122.102,192.168.122.103"
 # 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
-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' }
+#
+# 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
@@ -37,6 +41,11 @@ rbd_devices:
 # - status shows the intended state of this client definition - 'present' or 'absent'
 #
 # NB. this definition can be commented out to skip client (nodeACL) management
-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' }
+#
+# 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: {}
diff --git a/roles/ceph-iscsi-gw/tasks/check_mandatory_vars.yml b/roles/ceph-iscsi-gw/tasks/check_mandatory_vars.yml
new file mode 100644 (file)
index 0000000..98b51f8
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- 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 == "0.0.0.0"
index d270facb5f5e45053d9e6e8a51b77d310b0c37c5..4138b0c498686cb79ef0bce9cdb5d2470a426a8e 100644 (file)
@@ -13,7 +13,7 @@
     size: "{{ item.size }}"
     host: "{{ item.host }}"
     state: "{{ item.state }}"
-  with_items: "{{ rbd_devices|default([]) }}"
+  with_items: "{{ rbd_devices }}"
   register: images
 
 - name: igw_gateway (map) | map luns to the iscsi target
@@ -29,5 +29,5 @@
     image_list: "{{ item.image_list }}"
     chap: "{{ item.chap }}"
     state: "{{ item.status }}"
-  with_items: "{{ client_connections|default([]) }}"
+  with_items: "{{ client_connections }}"
   register: clients
index f3d4989a7eb6f06d58a9b687c26dbe7fbf24bac9..1846ee0b119420b3a23864dd12369dd81a90869b 100644 (file)
     - "{{ crt_files_exist.results }}"
   when: item.1.stat.exists == true
 
+- name: set_fact generate_crt
+  set_fact:
+    generate_crt: true
+  with_items: "{{ crt_files_exist.results }}"
+  when: item.stat.exists == false
+
 - name: include generate_crt.yml
   include: generate_crt.yml
-  with_together:
-    - "{{ crt_files }}"
-    - "{{ crt_files_exist.results }}"
-  when: item.1.stat.exists == false
+  when: generate_crt|bool|default(false)
index ade5fe2c7e3599011243d67874bf1c09d290c59f..3cde512fb347571ff4206e79c8c2eabe40a811f4 100644 (file)
@@ -1,4 +1,7 @@
 ---
+- name: check_mandatory_vars.yml
+  include: check_mandatory_vars.yml
+
 - name: include prerequisites.yml
   include: prerequisites.yml
 
index 3cc4670bf3913619241fb0540379b3246feace69..6b877100fde8515d50ae12600706ddb3b8f15140 100644 (file)
@@ -22,8 +22,8 @@
   copy:
     src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
     dest: "/etc/ceph/{{ cluster }}.client.admin.keyring"
-    owner: "ceph"
-    group: "ceph"
+    owner: "root"
+    group: "root"
     mode: "0600"
   when:
     - cephx
index ce0d859f7b1e06c809cc76263188271c69fa2521..422ebc6ad4e1774b204099d871bcb89d4e74b208 100644 (file)
@@ -5,7 +5,7 @@
 
 [config]
 cluster_name = {{ cluster }}
-gateway_keyring = /etc/ceph/{{ cluster }}.client.admin.keyring
+gateway_keyring = {{ cluster }}.client.admin.keyring
 
 
 # Optional settings related to the CLI/API service
diff --git a/tests/functional/centos/7/cluster/group_vars/iscsi_gws b/tests/functional/centos/7/cluster/group_vars/iscsi_gws
new file mode 100644 (file)
index 0000000..f08f50a
--- /dev/null
@@ -0,0 +1,2 @@
+---
+gateway_ip_list: 192.168.1.90
index bddde7c58fe0f0c0291a8a03c3c2ac05a1456482..b0bf472bc335cc99a8063431342738957b9cb5a6 100644 (file)
@@ -24,5 +24,5 @@ ceph-nfs0
 [rbdmirrors]
 ceph-rbd-mirror0
 
-#[iscsi_gws]
-#ceph-iscsi-gw0 ceph_repository="dev"
+[iscsi_gws]
+ceph-iscsi-gw0 ceph_repository="dev"
index 5fc482e9802739a265117a81903a07fcd9b76618..9462f75ae0eeaea5ec51704e63c657deb3f03d95 100644 (file)
@@ -11,7 +11,7 @@ rgw_vms: 1
 nfs_vms: 1
 rbd_mirror_vms: 1
 client_vms: 1
-iscsi_gw_vms: 0
+iscsi_gw_vms: 1
 mgr_vms: 1
 
 # Deploy RESTAPI on each of the Monitors