Commit 367dce28 authored by Dimitri Savineau's avatar Dimitri Savineau Committed by mergify[bot]
Browse files

ceph-dashboard: enable rgw options conditionally



The dashboard rgw frontend options only need to be applied when there's
some nodes present in the rgw ansible group.
Signed-off-by: default avatarDimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 5383c2f7)
parent c0abaec0
...@@ -104,62 +104,65 @@ ...@@ -104,62 +104,65 @@
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false changed_when: false
- name: create radosgw system user - name: dashboard object gateway management frontend
shell: "timeout 20 {{ container_exec_cmd }} radosgw-admin user create --uid={{ dashboard_rgw_api_user_id }} --display-name='Ceph dashboard' --system" when: groups.get(rgw_group_name, []) | length > 0
register: rgw_user_output block:
until: rgw_user_output.rc == 0 - name: create radosgw system user
retries: 3 shell: "timeout 20 {{ container_exec_cmd }} radosgw-admin user create --uid={{ dashboard_rgw_api_user_id }} --display-name='Ceph dashboard' --system"
delegate_to: "{{ groups[mon_group_name][0] }}" register: rgw_user_output
until: rgw_user_output.rc == 0
- name: get the rgw access and secret keys retries: 3
set_fact: delegate_to: "{{ groups[mon_group_name][0] }}"
rgw_access_key: "{{ (rgw_user_output.stdout | from_json)['keys'][0]['access_key'] }}"
rgw_secret_key: "{{ (rgw_user_output.stdout | from_json)['keys'][0]['secret_key'] }}" - name: get the rgw access and secret keys
set_fact:
- name: set the rgw user rgw_access_key: "{{ (rgw_user_output.stdout | from_json)['keys'][0]['access_key'] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-user-id {{ dashboard_rgw_api_user_id }}" rgw_secret_key: "{{ (rgw_user_output.stdout | from_json)['keys'][0]['secret_key'] }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false - name: set the rgw user
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-user-id {{ dashboard_rgw_api_user_id }}"
- name: set the rgw access key delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-access-key {{ rgw_access_key }}" changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false - name: set the rgw access key
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-access-key {{ rgw_access_key }}"
- name: set the rgw secret key delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-secret-key {{ rgw_secret_key }}" changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false - name: set the rgw secret key
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-secret-key {{ rgw_secret_key }}"
- name: set the rgw host delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-host {{ dashboard_rgw_api_host }}" changed_when: false
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}" - name: set the rgw host
when: dashboard_rgw_api_host != '' command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-host {{ dashboard_rgw_api_host }}"
changed_when: false
- name: set the rgw port delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-port {{ dashboard_rgw_api_port }}" when: dashboard_rgw_api_host != ''
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}" - name: set the rgw port
when: dashboard_rgw_api_port != '' command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-port {{ dashboard_rgw_api_port }}"
changed_when: false
- name: set the rgw scheme delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-scheme {{ dashboard_rgw_api_scheme }}" when: dashboard_rgw_api_port != ''
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}" - name: set the rgw scheme
when: dashboard_rgw_api_scheme != '' command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-scheme {{ dashboard_rgw_api_scheme }}"
changed_when: false
- name: set the rgw admin resource delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-admin-resource {{ dashboard_rgw_api_admin_resource }}" when: dashboard_rgw_api_scheme != ''
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}" - name: set the rgw admin resource
when: dashboard_rgw_api_admin_resource != '' command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-admin-resource {{ dashboard_rgw_api_admin_resource }}"
changed_when: false
- name: disable ssl verification for rgw delegate_to: "{{ groups[mon_group_name][0] }}"
command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-ssl-verify False" when: dashboard_rgw_api_admin_resource != ''
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}" - name: disable ssl verification for rgw
when: dashboard_rgw_api_no_ssl_verify | bool command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-ssl-verify False"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
when: dashboard_rgw_api_no_ssl_verify | bool
- name: disable mgr dashboard module (restart) - name: disable mgr dashboard module (restart)
command: "{{ container_exec_cmd }} ceph mgr module disable dashboard" command: "{{ container_exec_cmd }} ceph mgr module disable dashboard"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment