Browse Source

add playbook to create my database users with privileges

master
Markus Bergholz 2 years ago
parent
commit
536987f9fa
1 changed files with 27 additions and 0 deletions
  1. +27
    -0
      ansible/mariadb_users.yml

+ 27
- 0
ansible/mariadb_users.yml View File

@ -0,0 +1,27 @@
---
- hosts: osuv
vars:
NC_TOKEN: "{{ lookup('env', 'NC_TOKEN') }}"
tasks:
- name: add or update gitea user
mysql_user:
login_host: 127.0.0.1
login_password: "{{ lookup('nc_password', 'root_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
login_port: 3307
login_user: m
name: gitea
password: "{{ lookup('nc_password', 'gitea_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
priv: "gitea.*:ALL"
state: present
- name: add or update nextcloud user
mysql_user:
login_host: 127.0.0.1
login_password: "{{ lookup('nc_password', 'root_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
login_port: 3307
login_user: m
name: nextcloud
password: "{{ lookup('nc_password', 'nextcloud_mariadb_password' , host='home.osuv.de', user='m', token=NC_TOKEN) }}"
priv: "nextcloud.*:ALL"
state: present

Loading…
Cancel
Save