2018-12-06 02:59:47 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Import ceph-facts role
|
|
|
|
ansible.builtin.import_role:
|
2022-08-01 21:36:48 +08:00
|
|
|
name: ceph-facts
|
|
|
|
tasks_from: container_binary.yml
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
delegate_facts: true
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set_fact container_exec_cmd
|
|
|
|
ansible.builtin.set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }}"
|
2019-05-22 16:02:42 +08:00
|
|
|
when: containerized_deployment | bool
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set_fact container_run_cmd
|
|
|
|
ansible.builtin.set_fact:
|
2021-03-01 22:22:22 +08:00
|
|
|
ceph_cmd: "{{ hostvars[groups[mon_group_name][0]]['container_binary'] + ' run --interactive --net=host --rm -v /etc/ceph:/etc/ceph:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }}"
|
2021-01-07 19:40:18 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Get current mgr backend - ipv4
|
|
|
|
ansible.builtin.set_fact:
|
2022-03-25 16:14:56 +08:00
|
|
|
dashboard_server_addr: "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(dashboard_network.split(',')) | first }}"
|
2021-07-06 20:18:51 +08:00
|
|
|
when: ip_version == 'ipv4'
|
2022-03-25 16:14:56 +08:00
|
|
|
loop: "{{ groups.get(mgr_group_name) if groups.get(mgr_group_name, []) | length > 0 else groups.get(mon_group_name) }}"
|
|
|
|
delegate_to: "{{ item }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
delegate_facts: true
|
2021-07-06 20:18:51 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Get current mgr backend - ipv6
|
|
|
|
ansible.builtin.set_fact:
|
2022-03-25 16:14:56 +08:00
|
|
|
dashboard_server_addr: "{{ hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(dashboard_network.split(',')) | last }}"
|
2021-07-06 20:18:51 +08:00
|
|
|
when: ip_version == 'ipv6'
|
2022-03-25 16:14:56 +08:00
|
|
|
loop: "{{ groups.get(mgr_group_name) if groups.get(mgr_group_name, []) | length > 0 else groups.get(mon_group_name) }}"
|
|
|
|
delegate_to: "{{ item }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
delegate_facts: true
|
2021-07-06 20:18:51 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include ceph-facts role
|
|
|
|
ansible.builtin.include_role:
|
2022-04-13 16:42:47 +08:00
|
|
|
name: ceph-facts
|
|
|
|
tasks_from: set_radosgw_address.yml
|
2022-10-18 21:28:54 +08:00
|
|
|
loop: "{{ groups.get(rgw_group_name, []) }}"
|
2023-09-05 18:32:53 +08:00
|
|
|
run_once: true
|
2022-04-13 16:42:47 +08:00
|
|
|
loop_control:
|
|
|
|
loop_var: ceph_dashboard_call_item
|
2022-10-18 21:28:54 +08:00
|
|
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
2022-04-13 16:42:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable SSL for dashboard
|
2019-05-15 20:35:24 +08:00
|
|
|
when: dashboard_protocol == "http"
|
2020-07-13 18:40:17 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2020-08-25 04:05:57 +08:00
|
|
|
run_once: true
|
2020-07-13 18:40:17 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Get SSL status for dashboard
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config get mgr mgr/dashboard/ssl"
|
|
|
|
changed_when: false
|
|
|
|
register: current_ssl_for_dashboard
|
2020-07-13 18:40:17 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable SSL for dashboard
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/ssl false"
|
|
|
|
changed_when: false
|
|
|
|
when: current_ssl_for_dashboard.stdout == "true"
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: With SSL for dashboard
|
2018-12-06 02:59:47 +08:00
|
|
|
when: dashboard_protocol == "https"
|
2019-10-03 03:24:38 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Enable SSL for dashboard
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/ssl true"
|
2019-10-03 03:24:38 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
2024-02-14 18:14:02 +08:00
|
|
|
changed_when: false
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy dashboard SSL certificate file
|
|
|
|
ansible.builtin.copy:
|
2019-10-03 03:24:38 +08:00
|
|
|
src: "{{ dashboard_crt }}"
|
|
|
|
dest: "/etc/ceph/ceph-dashboard.crt"
|
|
|
|
owner: root
|
|
|
|
group: root
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0440"
|
2020-07-31 00:04:18 +08:00
|
|
|
remote_src: "{{ dashboard_tls_external | bool }}"
|
2020-07-17 22:38:02 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-10-03 03:24:38 +08:00
|
|
|
when: dashboard_crt | length > 0
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy dashboard SSL certificate key
|
|
|
|
ansible.builtin.copy:
|
2019-10-03 03:24:38 +08:00
|
|
|
src: "{{ dashboard_key }}"
|
|
|
|
dest: "/etc/ceph/ceph-dashboard.key"
|
|
|
|
owner: root
|
|
|
|
group: root
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0440"
|
2020-07-31 00:04:18 +08:00
|
|
|
remote_src: "{{ dashboard_tls_external | bool }}"
|
2020-07-17 22:38:02 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-10-03 03:24:38 +08:00
|
|
|
when: dashboard_key | length > 0
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Generate and copy self-signed certificate
|
2019-10-03 03:24:38 +08:00
|
|
|
when: dashboard_key | length == 0 or dashboard_crt | length == 0
|
2021-08-09 22:33:40 +08:00
|
|
|
run_once: true
|
2020-06-23 17:11:06 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set_fact subj_alt_names
|
|
|
|
ansible.builtin.set_fact:
|
2021-07-06 20:18:51 +08:00
|
|
|
subj_alt_names: >
|
2024-02-14 18:14:02 +08:00
|
|
|
{% for host in groups[mgr_group_name] | default(groups[mon_group_name]) -%} DNS:{{ hostvars[host]['ansible_facts']['hostname'] }},DNS:{{ hostvars[host]['ansible_facts']['fqdn'] }},IP:{{ hostvars[host]['dashboard_server_addr'] }}{% if not loop.last %},{% endif %}{%- endfor -%}
|
2021-08-09 22:33:40 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create tempfile for openssl certificate and key generation
|
|
|
|
ansible.builtin.tempfile:
|
2021-08-09 22:33:40 +08:00
|
|
|
state: file
|
|
|
|
register: openssl_config_file
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy the openssl configuration file
|
|
|
|
ansible.builtin.copy:
|
2021-08-09 22:33:40 +08:00
|
|
|
src: "{{ '/etc/pki/tls/openssl.cnf' if ansible_facts['os_family'] == 'RedHat' else '/etc/ssl/openssl.cnf' }}"
|
|
|
|
dest: '{{ openssl_config_file.path }}'
|
|
|
|
remote_src: true
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0644"
|
2021-08-09 22:33:40 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Add subjectAltName to the openssl configuration
|
|
|
|
community.general.ini_file:
|
2021-08-09 22:33:40 +08:00
|
|
|
path: '{{ openssl_config_file.path }}'
|
|
|
|
section: v3_ca
|
|
|
|
option: subjectAltName
|
|
|
|
value: '{{ subj_alt_names | trim }}'
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0644"
|
2021-07-06 20:18:51 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Generate a Self Signed OpenSSL certificate for dashboard
|
|
|
|
ansible.builtin.shell: |
|
2020-06-23 17:11:06 +08:00
|
|
|
test -f /etc/ceph/ceph-dashboard.key -a -f /etc/ceph/ceph-dashboard.crt || \
|
2021-08-09 22:33:40 +08:00
|
|
|
openssl req -new -nodes -x509 -subj '/O=IT/CN={{ dashboard_certificate_cn }}/' -config {{ openssl_config_file.path }} -days 3650 -keyout /etc/ceph/ceph-dashboard.key -out /etc/ceph/ceph-dashboard.crt -extensions v3_ca
|
2024-02-14 18:14:02 +08:00
|
|
|
changed_when: false
|
2021-08-09 22:33:40 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Remove the openssl tempfile
|
|
|
|
ansible.builtin.file:
|
2021-08-09 22:33:40 +08:00
|
|
|
path: '{{ openssl_config_file.path }}'
|
|
|
|
state: absent
|
2020-06-23 17:11:06 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Slurp self-signed generated certificate for dashboard
|
|
|
|
ansible.builtin.slurp:
|
2020-06-23 17:11:06 +08:00
|
|
|
src: "/etc/ceph/{{ item }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
run_once: true
|
2020-06-23 17:11:06 +08:00
|
|
|
with_items:
|
|
|
|
- 'ceph-dashboard.key'
|
|
|
|
- 'ceph-dashboard.crt'
|
|
|
|
register: slurp_self_signed_crt
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy self-signed generated certificate on mons
|
|
|
|
ansible.builtin.copy:
|
2020-06-23 17:11:06 +08:00
|
|
|
dest: "{{ item.0.source }}"
|
|
|
|
content: "{{ item.0.content | b64decode }}"
|
|
|
|
owner: "{{ ceph_uid }}"
|
|
|
|
group: "{{ ceph_uid }}"
|
|
|
|
mode: "{{ '0600' if item.0.source.split('.')[-1] == 'key' else '0664' }}"
|
|
|
|
delegate_to: "{{ item.1 }}"
|
|
|
|
with_nested:
|
|
|
|
- "{{ slurp_self_signed_crt.results }}"
|
|
|
|
- "{{ groups[mon_group_name] }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Import dashboard certificate file
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config-key set mgr/dashboard/crt -i /etc/ceph/ceph-dashboard.crt"
|
2019-10-03 03:24:38 +08:00
|
|
|
changed_when: false
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Import dashboard certificate key
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config-key set mgr/dashboard/key -i /etc/ceph/ceph-dashboard.key"
|
2019-10-03 03:24:38 +08:00
|
|
|
changed_when: false
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set the dashboard port
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/server_port {{ dashboard_port }}"
|
2019-07-31 15:51:12 +08:00
|
|
|
changed_when: false
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set the dashboard SSL port
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/ssl_server_port {{ dashboard_port }}"
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|
2019-07-31 15:51:12 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false # Do not fail if the option does not exist, it only exists post-14.2.0
|
2019-04-05 01:51:16 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Config the current dashboard backend
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/{{ hostvars[item]['ansible_facts']['hostname'] }}/server_addr {{ hostvars[item]['dashboard_server_addr'] }}"
|
2021-07-06 20:18:51 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
run_once: true
|
2020-06-27 01:28:04 +08:00
|
|
|
with_items: '{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}'
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable mgr dashboard module (restart)
|
2020-11-16 23:11:20 +08:00
|
|
|
ceph_mgr_module:
|
|
|
|
name: dashboard
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
state: disable
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Enable mgr dashboard module (restart)
|
2020-11-16 23:11:20 +08:00
|
|
|
ceph_mgr_module:
|
|
|
|
name: dashboard
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
state: enable
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create dashboard admin user
|
2020-09-05 02:49:07 +08:00
|
|
|
ceph_dashboard_user:
|
|
|
|
name: "{{ dashboard_admin_user }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
password: "{{ dashboard_admin_password }}"
|
|
|
|
roles: ["{{ 'read-only' if dashboard_admin_user_ro | bool else 'administrator' }}"]
|
2020-08-20 05:33:51 +08:00
|
|
|
run_once: true
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2020-09-05 02:49:07 +08:00
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable unused dashboard features
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard feature disable {{ item }}"
|
2021-09-21 17:14:43 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
changed_when: false
|
|
|
|
with_items: "{{ dashboard_disabled_features }}"
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set grafana api user
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-username {{ grafana_admin_user }}"
|
2019-10-31 17:49:22 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
changed_when: false
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set grafana api password
|
|
|
|
ansible.builtin.command: "{{ ceph_cmd }} --cluster {{ cluster }} dashboard set-grafana-api-password -i -"
|
2021-01-07 19:40:18 +08:00
|
|
|
args:
|
|
|
|
stdin: "{{ grafana_admin_password }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
stdin_add_newline: false
|
2019-10-31 17:49:22 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
changed_when: false
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable ssl verification for grafana
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-ssl-verify False"
|
2020-04-29 01:31:01 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
- dashboard_protocol == "https"
|
|
|
|
- dashboard_grafana_api_no_ssl_verify | bool
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set alertmanager host
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host http://{{ grafana_server_addrs | first }}:{{ alertmanager_port }}"
|
2019-09-27 00:56:10 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
|
|
|
changed_when: false
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set prometheus host
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-prometheus-api-host http://{{ grafana_server_addrs | first }}:{{ prometheus_port }}"
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
changed_when: false
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include grafana layout tasks
|
|
|
|
ansible.builtin.include_tasks: configure_grafana_layouts.yml
|
2020-01-28 03:47:00 +08:00
|
|
|
with_items: '{{ grafana_server_addrs }}'
|
|
|
|
vars:
|
|
|
|
grafana_server_addr: '{{ item }}'
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Config monitoring api url vip
|
2020-02-12 20:58:59 +08:00
|
|
|
run_once: true
|
2021-04-09 23:16:03 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Config grafana api url vip
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-grafana-api-url {{ dashboard_protocol }}://{{ dashboard_frontend_vip }}:{{ grafana_port }}"
|
2021-04-09 23:16:03 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
when: dashboard_frontend_vip is defined and dashboard_frontend_vip | length > 0
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Config alertmanager api url
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-alertmanager-api-host {{ dashboard_protocol }}://{{ alertmanager_frontend_vip }}:{{ alertmanager_port }}"
|
2021-04-09 23:16:03 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
when: alertmanager_frontend_vip is defined and alertmanager_frontend_vip | length > 0
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Config prometheus api url
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-prometheus-api-host {{ dashboard_protocol }}://{{ prometheus_frontend_vip }}:{{ prometheus_port }}"
|
2021-04-09 23:16:03 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
when: prometheus_frontend_vip is defined and prometheus_frontend_vip | length > 0
|
2020-02-12 20:58:59 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Dashboard object gateway management frontend
|
2019-07-11 22:38:44 +08:00
|
|
|
when: groups.get(rgw_group_name, []) | length > 0
|
2020-08-25 04:05:57 +08:00
|
|
|
run_once: true
|
2021-08-17 23:27:57 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-07-11 22:38:44 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set the rgw credentials
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-credentials"
|
2019-07-11 22:38:44 +08:00
|
|
|
changed_when: false
|
2021-09-29 14:34:09 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
retries: 5
|
2019-07-11 22:38:44 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Set the rgw admin resource
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-admin-resource {{ dashboard_rgw_api_admin_resource }}"
|
2019-07-11 22:38:44 +08:00
|
|
|
changed_when: false
|
2019-10-10 03:39:04 +08:00
|
|
|
when: dashboard_rgw_api_admin_resource | length > 0
|
2019-07-11 22:38:44 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable ssl verification for rgw
|
|
|
|
ansible.builtin.command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-ssl-verify False"
|
2019-07-11 22:38:44 +08:00
|
|
|
changed_when: false
|
2019-10-03 02:15:45 +08:00
|
|
|
when:
|
|
|
|
- dashboard_rgw_api_no_ssl_verify | bool
|
|
|
|
- radosgw_frontend_ssl_certificate | length > 0
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Disable mgr dashboard module (restart)
|
2020-11-16 23:11:20 +08:00
|
|
|
ceph_mgr_module:
|
|
|
|
name: dashboard
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
state: disable
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Enable mgr dashboard module (restart)
|
2020-11-16 23:11:20 +08:00
|
|
|
ceph_mgr_module:
|
|
|
|
name: dashboard
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
state: enable
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2019-05-14 20:46:25 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2019-08-02 22:58:11 +08:00
|
|
|
run_once: true
|