dataset/seed/postgresql/templates/postgresql.sql

13 lines
641 B
MySQL
Raw Normal View History

2022-07-17 23:01:46 +02:00
%set %%new_accounts = [('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)
2022-07-17 23:01:46 +02:00
%set %%password = %%accounts["remote_" + %%name]["password_" + %%name]
%%new_accounts.append((%%name, %%password))%slurp
%end for
%for %%name, %%password in %%new_accounts
2022-03-08 19:42:28 +01:00
CREATE DATABASE "%%name";
2022-07-17 23:01:46 +02:00
CREATE ROLE "%%name" WITH LOGIN ENCRYPTED PASSWORD '%%password';
ALTER USER "%%name" PASSWORD '%%password';
2022-03-08 19:42:28 +01:00
GRANT ALL PRIVILEGES ON DATABASE "%%name" TO "%%name";
%end for