Fix cyclic-dependency between oss services
Pushkin uses postgresql, and creates dbs
using alembic migrations, but we are using
some INSERTS into new tables. This is the
reason for running 'postgresql.client' state twice.
With this patch we are create all required
tables on postgresql side, not on pushkin.
Related-Prod: PROD-14525
Change-Id: I35cacc33f66b71783a6086957a04e798a65d3987
diff --git a/postgresql/client/pushkin/security_monkey.yml b/postgresql/client/pushkin/security_monkey.yml
new file mode 100644
index 0000000..18154cd
--- /dev/null
+++ b/postgresql/client/pushkin/security_monkey.yml
@@ -0,0 +1,19 @@
+classes:
+ - system.postgresql.client
+parameters:
+ _param:
+ secmonkey_db_host: ${_param:haproxy_postgresql_bind_host}
+ secmonkey_db_user: secmonkey
+ secmonkey_db_user_password: secmonkey
+ postgresql:
+ client:
+ server:
+ server01:
+ database:
+ pushkin:
+ init:
+ maintenance_db: pushkin
+ force: true
+ queries:
+ - INSERT INTO login VALUES (${_param:secmonkey_login_id}, ${_param:secmonkey_application_id}) ON CONFLICT (id) DO UPDATE SET id = excluded.id;
+ - INSERT INTO device VALUES (${_param:secmonkey_application_id}, ${_param:secmonkey_login_id}, 42, 'security_audit_service', NULL, 1, NULL) ON CONFLICT (id) DO UPDATE SET id = excluded.id;