Merge "Drop Travis CI support"
diff --git a/LICENSE b/LICENSE
index 0b835f6..cdb66dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2016 tcp cloud a.s.
+Copyright (c) 2014-2019 Mirantis Inc. et al
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/README.rst b/README.rst
index d1f2146..f2dcd04 100644
--- a/README.rst
+++ b/README.rst
@@ -43,7 +43,7 @@
         enabled: true
         bind:
           host: 10.0.175.101
-        token: $(uuidgen) 
+        token: $(uuidgen)
         members:
         - host: 10.0.175.101
           name: etcd01
@@ -113,36 +113,3 @@
 =========
 
 * https://github.com/coreos/etcd
-
-Documentation and Bugs
-======================
-
-To learn how to install and update salt-formulas, consult the documentation
-available online at:
-
-    http://salt-formulas.readthedocs.io/
-
-In the unfortunate event that bugs are discovered, they should be reported to
-the appropriate issue tracker. Use Github issue tracker for specific salt
-formula:
-
-    https://github.com/salt-formulas/salt-formula-etcd/issues
-
-For feature requests, bug reports or blueprints affecting entire ecosystem,
-use Launchpad salt-formulas project:
-
-    https://launchpad.net/salt-formulas
-
-You can also join salt-formulas-users team and subscribe to mailing list:
-
-    https://launchpad.net/~salt-formulas-users
-
-Developers wishing to work on the salt-formulas projects should always base
-their work on master branch and submit pull request against specific formula.
-
-    https://github.com/salt-formulas/salt-formula-etcd
-
-Any questions or feedback is always welcome so feel free to join our IRC
-channel:
-
-    #salt-formulas @ irc.freenode.net
diff --git a/debian/control b/debian/control
index 7f1c6f4..1570672 100644
--- a/debian/control
+++ b/debian/control
@@ -1,12 +1,12 @@
 Source: salt-formula-etcd
-Maintainer: tcpcloud <cloud@tcpcloud.eu>
+Maintainer: Mirantis Dev <dev@mirantis.com>
 Section: admin
 Priority: optional
 Build-Depends: debhelper (>= 9), salt-master, python, python-yaml, salt-formula-linux
 Standards-Version: 3.9.6
-Homepage: http://www.tcpcloud.eu
-Vcs-Browser: https://github.com/tcpcloud/salt-formula-etcd
-Vcs-Git: https://github.com/tcpcloud/salt-formula-etcd.git
+Homepage: https://www.mirantis.com
+Vcs-Browser: https://gerrit.mcp.mirantis.com/#/admin/projects/salt-formulas/etcd
+Vcs-Git: https://gerrit.mcp.mirantis.com/salt-formulas/etcd.git
 
 Package: salt-formula-etcd
 Architecture: all
diff --git a/debian/copyright b/debian/copyright
index 3d9f5a8..f98fbea 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,12 +1,12 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: salt-formula-etcd
-Upstream-Contact: 
-Source: https://github.com/tcpcloud/salt-formula-etcd
+Upstream-Contact: Mirantis Dev <dev@mirantis.com>
+Source: https://gerrit.mcp.mirantis.com/#/admin/projects/salt-formulas/etcd
 
 Files: *
-Copyright: 2014-2015 tcp cloud a.s.
+Copyright: 2014-2019 Mirantis Inc. et al
 License: Apache-2.0
-  Copyright (C) 2014-2015 tcp cloud a.s.
+  Copyright (C) 2014-2019 Mirantis Inc. et al
   .
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
diff --git a/etcd/meta/prometheus.yml b/etcd/meta/prometheus.yml
index 88b5419..d30feef 100644
--- a/etcd/meta/prometheus.yml
+++ b/etcd/meta/prometheus.yml
@@ -1,5 +1,16 @@
 {%- from "etcd/map.jinja" import server, monitoring with context %}
+
+{%- set hostname = grains.get('nodename') %}
+{%- set etcd = {} %}
+{%- for member in server.members %}
+  {%- if member.name == hostname %}
+    {%- do etcd.update({'hostname': hostname}) %}
+    {%- do etcd.update({'host': member.host}) %}
+    {%- do etcd.update({'port': member.port}) %}
+  {%- endif %}
+{%- endfor %}
 server:
+  {%- if etcd.host is defined and etcd.port is defined and etcd.hostname is defined %}
   target:
     static:
       etcd:
@@ -14,13 +25,14 @@
         scheme: http
         {%- endif %}
         endpoint:
-          {%- set hostname = grains.get('nodename') %}
-          {%- for member in server.members %}
-            {%- if member.name == hostname %}
-          - address: {{ member.host }}
-            port: {{ member.port }}
-            {%- endif %}
-          {%- endfor %}
+          - address: {{ etcd.host }}
+            port: {{ etcd.port }}
+        relabel_configs:
+          - regex: {{ etcd.host }}:{{ etcd.port }}
+            replacement: {{ etcd.hostname }}
+            source_labels: "__address__"
+            target_label: "host"
+  {%- endif %}
   alert:
     EtcdRequestFailureTooHigh:
       {%- set failed_http_requests = monitoring.failed_http_requests_percentage / 100.0 %}
diff --git a/metadata.yml b/metadata.yml
index 6f84faa..2be7dd8 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,6 +1,6 @@
 name: "etcd"
 version: "0.1"
-source: "https://github.com/salt-formulas/salt-formula-etcd"
+source: "https://gerrit.mcp.mirantis.com/salt-formulas/etcd"
 dependencies:
 - name: linux
-  source: "https://github.com/salt-formulas/salt-formula-linux"
\ No newline at end of file
+  source: "https://gerrit.mcp.mirantis.com/salt-formulas/linux"