diff --git a/roles/docker-mariadb/tasks/main.yml b/roles/docker-mariadb/tasks/main.yml index 6b34f34f..e3876a0e 100644 --- a/roles/docker-mariadb/tasks/main.yml +++ b/roles/docker-mariadb/tasks/main.yml @@ -48,6 +48,12 @@ login_host: 127.0.0.1 login_port: 3306 +- name: Grant database privileges + ansible.builtin.shell: + cmd: "docker exec central-mariadb mariadb -u root -p{{ central_mariadb_root_password }} -e \"GRANT ALL PRIVILEGES ON {{database_name}}.* TO '{{database_username}}'@'%';\"" + args: + executable: /bin/bash + - name: "Create database user: {{ database_username }}" mysql_user: name: "{{database_username}}"