dataset/seed/mariadb/templates/mariadb.sql

13 lines
719 B
MySQL
Raw Normal View History

2022-07-05 22:09:16 +02:00
%set %%new_accounts = [('_gateway', 'rougail_test', %%get_password(server_name=%%domain_name_eth0, username='rougail_test', description="remote", type="cleartext", hide=%%hide_secret, temporary=True))]
2022-03-08 19:42:28 +01:00
%for %%server in %%accounts.remotes
%set %%name = %%normalize_family(%%server)
%set %%password = %%accounts['remote_' + %%name]['password_' + %%name]
2022-07-05 22:09:16 +02:00
%%new_accounts.append((%%str(%%server), %%name, %%password))
%end for
%for %%server, %%name, %%password in %%new_accounts
2022-03-08 19:42:28 +01:00
CREATE USER IF NOT EXISTS '%%name'@'%%server' IDENTIFIED BY '%%password';
CREATE DATABASE IF NOT EXISTS %%name CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON %%name.* TO '%%name'@'%%server' IDENTIFIED BY '%%password';
%end for
2022-07-05 22:09:16 +02:00
FLUSH PRIVILEGES;