Browse Source

fix mariadb users

master
Markus Bergholz 1 month ago
parent
commit
d981912008
1 changed files with 12 additions and 10 deletions
  1. 12
    10
      ansible/mariadb_users.yml

+ 12
- 10
ansible/mariadb_users.yml View File

@@ -3,30 +3,32 @@
vars:
NC_TOKEN: "{{ lookup('env', 'NC_TOKEN') }}"
MARIADB_PASSWORD: "{{ lookup('nc_password', 'root_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
list:
dbs:
- nextcloud
- gitea
- grafana

tasks:
- name: "add or update user"
mysql_user:
- name: "databases must be present"
mysql_db:
login_host: 127.0.0.1
login_password: "{{ MARIADB_PASSWORD }}"
login_port: 3307
login_user: m
name: "{{ item }}"
password: "{{ lookup('nc_password', item + '_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
priv: "{{ item }}.*:ALL"
state: present
with_items: "{{ list }}"
encoding: utf8mb4
with_items: "{{ dbs }}"

- name: "databases must be present"
mysql_db:
- name: "add or update user"
mysql_user:
login_host: 127.0.0.1
login_password: "{{ MARIADB_PASSWORD }}"
login_port: 3307
login_port: 3306
login_user: m
name: "{{ item }}"
host: "%"
password: "{{ lookup('nc_password', item + '_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
priv: "{{ item }}.*:ALL"
state: present
encoding: utf8mb4
with_items: "{{ list }}"

Loading…
Cancel
Save