]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dashboard: add ceph iscsi management
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 21 Oct 2019 19:45:19 +0000 (15:45 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 22 Oct 2019 21:24:17 +0000 (23:24 +0200)
When deploying with ceph-iscsi nodes and dashboard enabled, we need to
add the ceph iscsi gateway endpoints to the dashboard configuration and
add the mgr ip address in the trusted list in the iscsi gateway
configuration file.

Closes: #4638
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1764173
https://docs.ceph.com/docs/master/mgr/dashboard/#enabling-iscsi-management

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-iscsi-gw/tasks/common.yml

index 25389a950fad965c09dee56e8e101d83f21c6640..7084ced455234b98a8b733c2d4f8eff1bb63c81c 100644 (file)
         - dashboard_rgw_api_no_ssl_verify | bool
         - radosgw_frontend_ssl_certificate | length > 0
 
+- name: dashboard iscsi management
+  when: groups.get(iscsi_gw_group_name, []) | length > 0
+  block:
+    - name: disable iscsi api ssl verification
+      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-iscsi-api-ssl-verification false"
+      changed_when: false
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      run_once: true
+      when:
+        - api_secure | default(false) | bool
+        - generate_crt | default(false) | bool
+
+    - name: add iscsi gateways
+      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard iscsi-gateway-add {{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_default_ipv4']['address'] }}:{{ hostvars[item]['api_port'] | default(5000) }}"
+      changed_when: false
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      with_items: "{{ groups[iscsi_gw_group_name] }}"
+      run_once: true
+
 - name: inject grafana dashboard layouts
   command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard grafana dashboards update"
   delegate_to: "{{ groups[mon_group_name][0] }}"
index 93c8ba9b02bd5bc88b5faf951cfedce8ddd2833c..c531a6db9157a9f574a977de3d870449f431062a 100644 (file)
     - cephx | bool
     - item.item.copy_key | bool
 
+- name: add mgr ip address to trusted list with dashboard
+  set_fact:
+    trusted_ip_list: '{{ trusted_ip_list }},{{ hostvars[item]["ansible_all_ipv4_addresses"] | ips_in_ranges(public_network.split(",")) | first }}'
+  with_items: '{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}'
+  when: dashboard_enabled | bool
+
 - name: deploy gateway settings, used by the ceph_iscsi_config modules
   config_template:
     src: "{{ role_path }}/templates/iscsi-gateway.cfg.j2"