4ca2d41762
Second part of patchset: https://review.opendev.org/c/openstack/kolla-ansible/+/799229/ in which was suggested to split patch into smaller ones. THis change adds container_engine to module parameters so when we introduce podman, kolla_toolbox can be used for both engines. Signed-off-by: Ivan Halomi <i.halomi@partner.samsung.com> Co-authored-by: Martin Hiner <m.hiner@partner.samsung.com> Change-Id: Ic2093aa9341a0cb36df8f340cf290d62437504ad
28 lines
1.0 KiB
YAML
28 lines
1.0 KiB
YAML
---
|
|
- name: Creating prometheus database user and setting permissions
|
|
become: true
|
|
vars:
|
|
shard_id: "{{ item.key }}"
|
|
shard_root_user: "{% if mariadb_loadbalancer == 'haproxy' %}{{ database_user }}{% else %}{{ mariadb_shard_root_user_prefix }}{{ shard_id | string }}{% endif %}"
|
|
shard_host: "{{ mariadb_shards_info.shards[shard_id].hosts[0] }}"
|
|
kolla_toolbox:
|
|
container_engine: "{{ kolla_container_engine }}"
|
|
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:
|
|
- enable_prometheus_mysqld_exporter | bool
|
|
- not use_preconfigured_databases | bool
|