
Depends-On: https://review.opendev.org/c/openstack/kolla/+/769385 Depends-On: https://review.opendev.org/c/openstack/kolla/+/765781 Change-Id: I3c4182a6556dafd2c936eaab109a068674058fca
28 lines
991 B
YAML
28 lines
991 B
YAML
---
|
|
- name: Creating prometheus database user and setting permissions
|
|
become: true
|
|
vars:
|
|
shard_id: "{{ item.key }}"
|
|
shard_root_user: "{{ mariadb_shard_root_user_prefix }}{{ shard_id | string }}"
|
|
shard_host: "{{ mariadb_shards_info.shards[shard_id].hosts[0] }}"
|
|
kolla_toolbox:
|
|
module_name: mysql_user
|
|
module_args:
|
|
login_host: "{{ database_address }}"
|
|
login_port: "{{ mariadb_port }}"
|
|
login_user: "{{ shard_root_user }}"
|
|
login_password: "{{ database_password }}"
|
|
name: "{{ prometheus_mysql_exporter_database_user }}"
|
|
password: "{{ prometheus_mysql_exporter_database_password }}"
|
|
host: "%"
|
|
priv: "*.*:PROCESS,SLAVE MONITOR,SELECT"
|
|
append_privs: "yes"
|
|
with_dict: "{{ mariadb_shards_info.shards }}"
|
|
loop_control:
|
|
label: "{{ shard_host }}"
|
|
run_once: True
|
|
when:
|
|
- inventory_hostname == groups['prometheus'][0]
|
|
- enable_prometheus_mysqld_exporter | bool
|
|
- not use_preconfigured_databases | bool
|