paulbsd-salt/states/mariadb/users.sls

24 lines
733 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "mariadb/map.jinja" import mariadb with context %}
2023-09-14 16:45:40 +02:00
{%- for name, user in mariadb.users.items() %}
mariadb-user-{{ name }}:
2020-07-10 00:58:55 +02:00
mysql_user.present:
2023-09-14 16:45:40 +02:00
- name: {{ name }}
2020-07-10 00:58:55 +02:00
- password: {{ user.password }}
- host: '{{ user.host }}'
- connection_user: {{ mariadb.connection_user }}
- connection_pass: {{ mariadb.connection_pass }}
{%- for grant in user.grants %}
mariadb-grants-{{ grant.name }}:
mysql_grants.present:
- name: {{ grant.name }}
- grant: '{{ grant.grant }}'
- database: '{{ grant.database }}'
2023-09-14 16:45:40 +02:00
- user: '{{ name }}'
2020-07-10 00:58:55 +02:00
- host: '{{ user.host }}'
- connection_user: {{ mariadb.connection_user }}
- connection_pass: {{ mariadb.connection_pass }}
{%- endfor %}
{%- endfor %}