paulbsd-salt/states/mariadb/users.sls

24 lines
747 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "mariadb/map.jinja" import mariadb with context %}
{%- for key, user in mariadb.users.items() %}
mariadb-user-{{ user.name }}:
mysql_user.present:
- name: {{ user.name }}
- 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 }}'
- user: '{{ user.name }}'
- host: '{{ user.host }}'
- connection_user: {{ mariadb.connection_user }}
- connection_pass: {{ mariadb.connection_pass }}
{%- endfor %}
{%- endfor %}