]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-dashboard: remove rgw api host,port,scheme
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 2 Oct 2019 18:15:45 +0000 (14:15 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 7 Oct 2019 09:22:44 +0000 (11:22 +0200)
We don't need to have dedicated variables for the RGW integration into
the Ceph Dashboard and need to be manually filled.
Instead we can use the current values from the RGW nodes by using the
IP and port from the first RGW instance of the first RGW node via the
radosgw_address and radosgw_frontend_port variables.
We don't need to specify all RGW nodes, this will be done automatically
with one node.
The RGW api scheme is using the radosgw_frontend_ssl_certificate variable
to determine if the value is http or https. This variable is also reuse
as a condition for the ssl verify task.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-defaults/defaults/main.yml

index 7b30c18d83c8fc720ebabb977eac7023bc736663..a1f5b807c3f9244d6d0b72ecdb849a43d3595ccf 100644 (file)
@@ -713,9 +713,6 @@ dummy:
 #dashboard_crt: ''
 #dashboard_key: ''
 #dashboard_rgw_api_user_id: ceph-dashboard
-#dashboard_rgw_api_host: ''
-#dashboard_rgw_api_port: ''
-#dashboard_rgw_api_scheme: ''
 #dashboard_rgw_api_admin_resource: ''
 #dashboard_rgw_api_no_ssl_verify: False
 #node_exporter_container_image: prom/node-exporter:latest
index f7f42aa696deb04e0f300639f429caf3a827965b..1a74ce28959a940f619db82ed82fa8dea2ebc7b8 100644 (file)
@@ -713,9 +713,6 @@ ceph_docker_registry_auth: true
 #dashboard_crt: ''
 #dashboard_key: ''
 #dashboard_rgw_api_user_id: ceph-dashboard
-#dashboard_rgw_api_host: ''
-#dashboard_rgw_api_port: ''
-#dashboard_rgw_api_scheme: ''
 #dashboard_rgw_api_admin_resource: ''
 #dashboard_rgw_api_no_ssl_verify: False
 node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.1
index bf249d5ce4e80cd2d5f6d08fb8fbc630b58d218f..9fb96f017954c79dc97985c4e8e4a2b39d55d799 100644 (file)
       changed_when: false
 
     - name: set the rgw host
-      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-host {{ dashboard_rgw_api_host }}"
+      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-host {{ hostvars[groups[rgw_group_name][0]]['rgw_instances'][0]['radosgw_address'] }}"
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: true
-      when: dashboard_rgw_api_host != ''
 
     - name: set the rgw port
-      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-port {{ dashboard_rgw_api_port }}"
+      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-port {{ hostvars[groups[rgw_group_name][0]]['rgw_instances'][0]['radosgw_frontend_port'] }}"
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: true
-      when: dashboard_rgw_api_port != ''
 
     - name: set the rgw scheme
-      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-scheme {{ dashboard_rgw_api_scheme }}"
+      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-scheme {{ 'https' if radosgw_frontend_ssl_certificate else 'http' }}"
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: true
-      when: dashboard_rgw_api_scheme != ''
 
     - name: set the rgw admin resource
       command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-admin-resource {{ dashboard_rgw_api_admin_resource }}"
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: true
-      when: dashboard_rgw_api_no_ssl_verify | bool
+      when:
+        - dashboard_rgw_api_no_ssl_verify | bool
+        - radosgw_frontend_ssl_certificate | length > 0
 
 - name: disable mgr dashboard module (restart)
   command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} mgr module disable dashboard"
index 19b9cc2eac9231d8c19ed0f3c6535f199972dedd..75ff1b16ea28e9d23718df9aaaed4cb73933c031 100644 (file)
@@ -705,9 +705,6 @@ dashboard_admin_password: admin
 dashboard_crt: ''
 dashboard_key: ''
 dashboard_rgw_api_user_id: ceph-dashboard
-dashboard_rgw_api_host: ''
-dashboard_rgw_api_port: ''
-dashboard_rgw_api_scheme: ''
 dashboard_rgw_api_admin_resource: ''
 dashboard_rgw_api_no_ssl_verify: False
 node_exporter_container_image: prom/node-exporter:latest