define metadata for alertmanager and smtp config

Change-Id: I175991cc977d14c24523b0c6940b51078778def9
diff --git a/docker/swarm/stack/pushkin.yml b/docker/swarm/stack/pushkin.yml
index 593f532..13198b7 100644
--- a/docker/swarm/stack/pushkin.yml
+++ b/docker/swarm/stack/pushkin.yml
@@ -7,6 +7,8 @@
     pushkin_ssl:
       enabled: false
     pushkin_db: pushkin
+    pushkin_smtp_host: smtp.gmail.com
+    pushkin_smtp_port: 587
   docker:
     client:
       stack:
@@ -18,6 +20,9 @@
             PUSHKINDBHOST: ${_param:postgresql_bind_host}
             PUSHKINELASTICHOST: ${_param:elasticsearch_bind_host}
             WEBHOOK_FROM: ${_param:webhook_from}
+            EMAIL_SENDER_PASSWORD: ${_param:pushkin_email_sender_password}
+            SMTP_HOST: ${_param:pushkin_smtp_host}
+            SMTP_PORT: ${_param:pushkin_smtp_port}
             WEBHOOK_RECIPIENTS: ${_param:webhook_recipients}
             WEBHOOK_LOGIN_ID: ${_param:webhook_login_id}
             WEBHOOK_APPLICATION_ID: ${_param:webhook_application_id}
@@ -33,7 +38,3 @@
                 - ${_param:haproxy_pushkin_exposed_port}:${_param:haproxy_pushkin_bind_port}
               volumes:
                 - /srv/volumes/pushkin/api:/var/log/pushkin
-          network:
-            default:
-              external:
-                name: oss_backend
diff --git a/postgresql/client/alertmanager.yml b/postgresql/client/alertmanager.yml
new file mode 100644
index 0000000..8bd272a
--- /dev/null
+++ b/postgresql/client/alertmanager.yml
@@ -0,0 +1,30 @@
+classes:
+  - system.postgresql.client
+parameters:
+  _param:
+    alertmanager_db_host: ${_param:haproxy_postgresql_bind_host}
+    alertmanager_db_user: alertmanager
+    alertmanager_db_user_password: alertmanager
+    webhook_login_id: 13
+    webhook_application_id: 24
+  postgresql:
+    client:
+      server:
+        server01:
+          database:
+            alertmanager:
+              enabled: true
+              encoding: 'UTF8'
+              locale: 'en_US'
+              users:
+              - name: ${_param:alertmanager_db_user}
+                password: ${_param:alertmanager_db_user_password}
+                host: ${_param:alertmanager_db_host}
+                createdb: true
+                rights: all privileges
+              init:
+                maintenance_db: pushkin
+                force: true
+                queries:
+                - INSERT INTO login VALUES (${_param:webhook_login_id}, ${_param:webhook_application_id}) ON CONFLICT (id) DO UPDATE SET id = excluded.id;
+                - INSERT INTO device VALUES (${_param:webhook_application_id}, ${_param:webhook_login_id}, 42, 'stacklight_alertmanager', NULL, 1, NULL) ON CONFLICT (id) DO UPDATE SET id = excluded.id;