validate: fail if dashboard|grafana_admin_password aren't set

This commit adds a task to make sure user set a custom password for
`grafana_admin_password` and `dashboard_admin_password` variables.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1795509

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 99328545de)
pull/5012/head
Guillaume Abrioux 2020-01-28 13:55:54 +01:00
parent 9da917501b
commit 8a907cb1ca
4 changed files with 15 additions and 2 deletions

View File

@ -706,6 +706,7 @@ dummy:
#dashboard_protocol: http #dashboard_protocol: http
#dashboard_port: 8443 #dashboard_port: 8443
#dashboard_admin_user: admin #dashboard_admin_user: admin
# This variable must be set with a strong custom password when dashboard_enabled is True
#dashboard_admin_password: p@ssw0rd #dashboard_admin_password: p@ssw0rd
# We only need this for SSL (https) connections # We only need this for SSL (https) connections
#dashboard_crt: '' #dashboard_crt: ''
@ -716,6 +717,7 @@ dummy:
#node_exporter_container_image: "prom/node-exporter:v0.17.0" #node_exporter_container_image: "prom/node-exporter:v0.17.0"
#node_exporter_port: 9100 #node_exporter_port: 9100
#grafana_admin_user: admin #grafana_admin_user: admin
# This variable must be set with a strong custom password when dashboard_enabled is True
#grafana_admin_password: admin #grafana_admin_password: admin
# We only need this for SSL (https) connections # We only need this for SSL (https) connections
#grafana_crt: '' #grafana_crt: ''

View File

@ -706,6 +706,7 @@ ceph_docker_registry_auth: true
#dashboard_protocol: http #dashboard_protocol: http
#dashboard_port: 8443 #dashboard_port: 8443
#dashboard_admin_user: admin #dashboard_admin_user: admin
# This variable must be set with a strong custom password when dashboard_enabled is True
#dashboard_admin_password: p@ssw0rd #dashboard_admin_password: p@ssw0rd
# We only need this for SSL (https) connections # We only need this for SSL (https) connections
#dashboard_crt: '' #dashboard_crt: ''
@ -716,6 +717,7 @@ ceph_docker_registry_auth: true
node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.1 node_exporter_container_image: registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.1
#node_exporter_port: 9100 #node_exporter_port: 9100
#grafana_admin_user: admin #grafana_admin_user: admin
# This variable must be set with a strong custom password when dashboard_enabled is True
#grafana_admin_password: admin #grafana_admin_password: admin
# We only need this for SSL (https) connections # We only need this for SSL (https) connections
#grafana_crt: '' #grafana_crt: ''

View File

@ -698,7 +698,8 @@ dashboard_enabled: True
dashboard_protocol: http dashboard_protocol: http
dashboard_port: 8443 dashboard_port: 8443
dashboard_admin_user: admin dashboard_admin_user: admin
dashboard_admin_password: p@ssw0rd # This variable must be set with a strong custom password when dashboard_enabled is True
#dashboard_admin_password: p@ssw0rd
# We only need this for SSL (https) connections # We only need this for SSL (https) connections
dashboard_crt: '' dashboard_crt: ''
dashboard_key: '' dashboard_key: ''
@ -708,7 +709,8 @@ dashboard_rgw_api_no_ssl_verify: False
node_exporter_container_image: "prom/node-exporter:v0.17.0" node_exporter_container_image: "prom/node-exporter:v0.17.0"
node_exporter_port: 9100 node_exporter_port: 9100
grafana_admin_user: admin grafana_admin_user: admin
grafana_admin_password: admin # This variable must be set with a strong custom password when dashboard_enabled is True
#grafana_admin_password: admin
# We only need this for SSL (https) connections # We only need this for SSL (https) connections
grafana_crt: '' grafana_crt: ''
grafana_key: '' grafana_key: ''

View File

@ -205,6 +205,13 @@
fail: fail:
msg: "you must add at least one node in the [grafana-server] hosts group" msg: "you must add at least one node in the [grafana-server] hosts group"
when: groups[grafana_server_group_name] | length < 1 when: groups[grafana_server_group_name] | length < 1
- name: fail when dashboard_admin_password and/or grafana_admin_password are not set
fail:
msg: "you must set dashboard_admin_password and grafana_admin_password."
when:
- dashboard_admin_password is undefined
or grafana_admin_password is undefined
when: dashboard_enabled | bool when: dashboard_enabled | bool
- name: validate container registry credentials - name: validate container registry credentials