consul-templaterb 1.9.8 → 1.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +21 -0
- data/README.md +3 -2
- data/lib/consul/async/version.rb +1 -1
- data/samples/consul-ui/README.md +1 -1
- data/samples/consul-ui/consul_nodes.json.erb +5 -3
- data/samples/consul-ui/consul_services.json.erb +4 -3
- data/samples/consul-ui/timeline.json.erb +3 -2
- data/samples/consul_template.json.erb +5 -3
- data/samples/consul_template_broken.txt.erb +10 -0
- data/samples/criteo/haproxy.cfg.erb +4 -3
- data/samples/ha_proxy.cfg.erb +4 -3
- data/samples/metrics.erb +5 -3
- data/samples/nodes.html.erb +3 -2
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bc60bdb2bf31bd1da18ee4623f62fdf7a664daa5f31a273712168591612a666
|
|
4
|
+
data.tar.gz: 05dbb95ce7faba2da08b30cd6c7e8cdd96246d4e0bd4fd93996b279c9c2f6c61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11019612ceefc6258fe2d578bfedc836689c82c7e3118621298d7eaea21b22e65a48778422e378b50ac7799f733af8c4af1d3330356b8a0d0b10758f829725f4
|
|
7
|
+
data.tar.gz: aa338fff43589ddbc32b6d8bc20982cbd58bf0f2fd556cc18c46865014592fdffb8b9ccd7f34d54a352b3476474ceb4edfd53b12785fa1a2e76c0f9836851a4b
|
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at p.souchay@criteo.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
72
|
+
|
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
|
74
|
+
|
|
75
|
+
For answers to common questions about this code of conduct, see
|
|
76
|
+
https://www.contributor-covenant.org/faq
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# How to contribute to Consul-Templaterb ?
|
|
2
|
+
|
|
3
|
+
## Samples
|
|
4
|
+
|
|
5
|
+
The [samples/](samples/) directory contains lots of useable templates that might help others using your new features.
|
|
6
|
+
Keep them less specific as possible (for instance use environment variables to allow others to use it directly
|
|
7
|
+
without relying on a specic path in KV).
|
|
8
|
+
|
|
9
|
+
Read first [TemplateAPI.md](TemplateAPI.md) to ensure you are using the best functions for the job, the API is kept
|
|
10
|
+
compact and powerful with many examples.
|
|
11
|
+
|
|
12
|
+
All the samples are unit-tested, so launch rspec before commiting, a template not converging will not be merged.
|
|
13
|
+
|
|
14
|
+
## Want new features/Found a bug?
|
|
15
|
+
|
|
16
|
+
[Report it](https://github.com/criteo/consul-templaterb/issues), but read carefully [TemplateAPI.md](TemplateAPI.md) and
|
|
17
|
+
[README.md](README.md)
|
|
18
|
+
|
|
19
|
+
## Want to add features/fix a bug?
|
|
20
|
+
|
|
21
|
+
Contributions in code are welcomed, create a fork and then a Pull Request, we will review it quickly.
|
data/README.md
CHANGED
|
@@ -303,9 +303,10 @@ Please consult [CHANGELOG.md](CHANGELOG.md) for fixed bugs.
|
|
|
303
303
|
|
|
304
304
|
## Contributing
|
|
305
305
|
|
|
306
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/criteo/consul-templaterb.
|
|
306
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidance: Bug reports and pull requests are welcome on GitHub at https://github.com/criteo/consul-templaterb.
|
|
307
|
+
|
|
307
308
|
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the
|
|
308
|
-
[Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
309
|
+
[Contributor Covenant](http://contributor-covenant.org) code of conduct. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
309
310
|
|
|
310
311
|
## License
|
|
311
312
|
|
data/lib/consul/async/version.rb
CHANGED
data/samples/consul-ui/README.md
CHANGED
|
@@ -65,6 +65,6 @@ This app supports the following environment variables:
|
|
|
65
65
|
* `SERVICES_TAG_FILTER`: basic tag filter for service (default HTTP)
|
|
66
66
|
* `INSTANCE_MUST_TAG`: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
67
67
|
* `INSTANCE_EXCLUDE_TAG`: Exclude instances having the given tag (default: canary)
|
|
68
|
-
* `EXCLUDE_SERVICES`: comma-separated services to exclude (default: consul-
|
|
68
|
+
* `EXCLUDE_SERVICES`: comma-separated services to exclude (default: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
69
69
|
* `CONSUL_TIMELINE_BUFFER`: number of entries to keep in the timeline. 1000 by default.
|
|
70
70
|
* `CONSUL_TIMELINE_BLACKLIST`: regexp of services to hide from timeline
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
# SERVICES_TAG_FILTER: basic tag filter for service (default HTTP)
|
|
5
5
|
# INSTANCE_MUST_TAG: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
6
6
|
# INSTANCE_EXCLUDE_TAG: Exclude instances having the given tag (default: canary)
|
|
7
|
-
# EXCLUDE_SERVICES: comma-separated services to exclude (default: consul-
|
|
7
|
+
# EXCLUDE_SERVICES: comma-separated services of regexps to exclude (default: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
8
8
|
|
|
9
9
|
service_tag_filter = ENV['SERVICES_TAG_FILTER'] || nil
|
|
10
10
|
instance_must_tag = ENV['INSTANCE_MUST_TAG'] || service_tag_filter
|
|
11
11
|
instance_exclude_tag = ENV['INSTANCE_EXCLUDE_TAG']
|
|
12
12
|
|
|
13
13
|
# Services to hide
|
|
14
|
-
|
|
14
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
15
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) } # Compute the health of a Service
|
|
16
|
+
|
|
15
17
|
service_per_node = {}
|
|
16
18
|
services.each do |service_name, tags|
|
|
17
|
-
if !services_blacklist.
|
|
19
|
+
if ! services_blacklist.any? {|r| r.match(service_name)}
|
|
18
20
|
service(service_name, tag: service_tag_filter).sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode|
|
|
19
21
|
node_info = service_per_node[snode['Node']['Node']] || {}
|
|
20
22
|
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
# SERVICES_TAG_FILTER: basic tag filter for service (default HTTP)
|
|
5
5
|
# INSTANCE_MUST_TAG: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
6
6
|
# INSTANCE_EXCLUDE_TAG: Exclude instances having the given tag (default: canary)
|
|
7
|
-
# EXCLUDE_SERVICES: comma-separated services to exclude (default: consul-
|
|
7
|
+
# EXCLUDE_SERVICES: comma-separated services regexps to exclude (default: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
8
8
|
|
|
9
9
|
service_tag_filter = ENV['SERVICES_TAG_FILTER'] || nil
|
|
10
10
|
instance_must_tag = ENV['INSTANCE_MUST_TAG'] || service_tag_filter
|
|
11
11
|
instance_exclude_tag = ENV['INSTANCE_EXCLUDE_TAG']
|
|
12
12
|
|
|
13
13
|
# Services to hide
|
|
14
|
-
|
|
14
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
15
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) }
|
|
15
16
|
|
|
16
17
|
def compute_attributes(snode)
|
|
17
18
|
w = 100
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
backends = {}
|
|
31
32
|
tags_per_service = {}
|
|
32
33
|
services(tag: service_tag_filter).each do |service_name, tags|
|
|
33
|
-
if !services_blacklist.
|
|
34
|
+
if !services_blacklist.any? {|r| r.match(service_name)} && (instance_must_tag.nil? || tags.include?(instance_must_tag))
|
|
34
35
|
tags_per_service[service_name] = tags.sort
|
|
35
36
|
the_backends = []
|
|
36
37
|
service(service_name).sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<%
|
|
2
2
|
require 'json'
|
|
3
3
|
require 'set'
|
|
4
|
-
|
|
4
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
5
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) } # Compute the health of a Service
|
|
5
6
|
timeline_blacklist = ENV['CONSUL_TIMELINE_BLACKLIST'] || '(lbl7-.*|netsvc-.*)'
|
|
6
7
|
timeline_blacklist = Regexp.new(timeline_blacklist)
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ timeline_blacklist = Regexp.new(timeline_blacklist)
|
|
|
9
10
|
@last_service_info = {}
|
|
10
11
|
@newest_index = 0 unless @newest_index
|
|
11
12
|
cur_state = services.map do |service_name, _tags|
|
|
12
|
-
next if services_blacklist.
|
|
13
|
+
next if services_blacklist.any? {|r| r.match(service_name)}
|
|
13
14
|
next if timeline_blacklist.match(service_name)
|
|
14
15
|
|
|
15
16
|
snodes = service(service_name)
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
# SERVICES_TAG_FILTER: basic tag filter for service (default HTTP)
|
|
5
5
|
# INSTANCE_MUST_TAG: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
6
6
|
# INSTANCE_EXCLUDE_TAG: Exclude instances having the given tag (default: canary)
|
|
7
|
-
# EXCLUDE_SERVICES: comma-separated services to exclude (default: consul-
|
|
7
|
+
# EXCLUDE_SERVICES: comma-separated services regexps to exclude (default: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
8
8
|
|
|
9
9
|
service_tag_filter = ENV['SERVICES_TAG_FILTER'] || 'http'
|
|
10
10
|
instance_must_tag = ENV['INSTANCE_MUST_TAG'] || service_tag_filter
|
|
11
11
|
instance_exclude_tag = ENV['INSTANCE_EXCLUDE_TAG'] || 'canary'
|
|
12
12
|
|
|
13
13
|
# Services to hide
|
|
14
|
-
|
|
14
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
15
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) } # Compute the health of a Service
|
|
16
|
+
|
|
15
17
|
# Compute the health of a Service
|
|
16
18
|
def compute_attributes(snode)
|
|
17
19
|
w = 100
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
end
|
|
30
32
|
backends = {}
|
|
31
33
|
services(tag: service_tag_filter).each do |service_name, tags|
|
|
32
|
-
if !services_blacklist.
|
|
34
|
+
if !services_blacklist.any? {|r| r.match(service_name)} && tags.include?(instance_must_tag)
|
|
33
35
|
the_backends = []
|
|
34
36
|
service(service_name, tag:'http').sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode|
|
|
35
37
|
tags_of_instance = snode['Service']['Tags']
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<%
|
|
2
|
+
services.each do |service_name, tags|
|
|
3
|
+
if tags.include? 'marathon'
|
|
4
|
+
service(service_name, tag:'marathon').sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode|
|
|
5
|
+
if (compute_state(snode)[0] == 'critical') && (snode['Service']['Tags'].include? 'marathon')
|
|
6
|
+
%>wssh "<%= snode['Node']['Node'] %>" time curl -v -XPUT localhost:8500/v1/agent/service/deregister/<%= snode['Service']['ID'] %>
|
|
7
|
+
<% end
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# SERVICES_TAG_FILTER: basic tag filter for service (default HTTP)
|
|
5
5
|
# INSTANCE_MUST_TAG: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
6
6
|
# INSTANCE_EXCLUDE_TAG: Exclude instances having the given tag (default: canary)
|
|
7
|
-
# EXCLUDE_SERVICES: comma-separated
|
|
7
|
+
# EXCLUDE_SERVICES: comma-separated service regexps to exclude (default: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
8
8
|
# Environment variables to configure HaProxy
|
|
9
9
|
# PORT0 : HaProxy main port (default to 8000)
|
|
10
10
|
# PORT1 : HaProxy admin port (default to 8001)
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
optional_dns_suffix = ENV['DNS_SUFFIX'] || ''
|
|
20
20
|
|
|
21
21
|
# Services to hide
|
|
22
|
-
|
|
22
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
23
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) }
|
|
23
24
|
|
|
24
25
|
def compute_attributes(node)
|
|
25
26
|
w = node.currrent_weight
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
backends = {}
|
|
39
40
|
all_kv = {}
|
|
40
41
|
services(tag: service_tag_filter).each do |service_name, tags|
|
|
41
|
-
if !services_blacklist.
|
|
42
|
+
if !services_blacklist.any? {|r| r.match(service_name)} && tags.include?(instance_must_tag)
|
|
42
43
|
the_backends = []
|
|
43
44
|
kv_data = kv("#{kv_root}/#{service_name}/network-service").get_value_json
|
|
44
45
|
all_kv[service_name] = kv_data if kv_data
|
data/samples/ha_proxy.cfg.erb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# SERVICES_TAG_FILTER: basic tag filter for service (default HTTP)
|
|
5
5
|
# INSTANCE_MUST_TAG: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
6
6
|
# INSTANCE_EXCLUDE_TAG: Exclude instances having the given tag (default: canary)
|
|
7
|
-
# EXCLUDE_SERVICES: comma-separated services to exclude (default: consul-
|
|
7
|
+
# EXCLUDE_SERVICES: comma-separated services regexps to exclude (default: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
8
8
|
# Environment variables to configure HaProxy
|
|
9
9
|
# PORT0 : HaProxy main port (default to 8000)
|
|
10
10
|
# PORT1 : HaProxy admin port (default to 8001)
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
instance_exclude_tag = ENV['INSTANCE_EXCLUDE_TAG'] || 'canary'
|
|
18
18
|
|
|
19
19
|
# Services to hide
|
|
20
|
-
|
|
20
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'consul-agent-http,mesos-slave,mesos-agent-watcher,mesos-exporter-slave').split(',')
|
|
21
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) }
|
|
21
22
|
|
|
22
23
|
def compute_attributes(snode)
|
|
23
24
|
w = 100
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
end
|
|
36
37
|
backends = {}
|
|
37
38
|
services(tag: service_tag_filter).each do |service_name, tags|
|
|
38
|
-
if !services_blacklist.
|
|
39
|
+
if !services_blacklist.any? {|r| r.match(service_name)} && tags.include?(instance_must_tag)
|
|
39
40
|
the_backends = []
|
|
40
41
|
service(service_name, tag:'http').sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |node|
|
|
41
42
|
tags_of_instance = node['Service']['Tags']
|
data/samples/metrics.erb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# SERVICES_TAG_FILTER: basic tag filter for service (default HTTP)
|
|
5
5
|
# INSTANCE_MUST_TAG: Second level of filtering (optional, default to SERVICES_TAG_FILTER)
|
|
6
6
|
# INSTANCE_EXCLUDE_TAG: Exclude instances having the given tag
|
|
7
|
-
# EXCLUDE_SERVICES: comma-separated services to exclude (example: consul-
|
|
7
|
+
# EXCLUDE_SERVICES: comma-separated services regexps to exclude (example: lbl7.*,netsvc-probe.*,consul-probed.*)
|
|
8
8
|
<%
|
|
9
9
|
|
|
10
10
|
service_tag_filter = ENV['SERVICES_TAG_FILTER'] || nil
|
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
instance_exclude_tag = ENV['INSTANCE_EXCLUDE_TAG']
|
|
13
13
|
|
|
14
14
|
# Services to hide
|
|
15
|
-
|
|
15
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
16
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) }
|
|
17
|
+
|
|
16
18
|
backends = {}
|
|
17
19
|
service_count = 0
|
|
18
20
|
services(tag: service_tag_filter).each do |service_name, tags|
|
|
19
|
-
if !services_blacklist.
|
|
21
|
+
if !services_blacklist.any? {|r| r.match(service_name)} && (instance_must_tag.nil? || tags.include?(instance_must_tag))
|
|
20
22
|
service_count += 1
|
|
21
23
|
res = {
|
|
22
24
|
'passing' => 0,
|
data/samples/nodes.html.erb
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<%= render_file('common/header.html.erb', title: 'Nodes') %><%
|
|
2
2
|
service_tag_filter = ENV['SERVICES_TAG_FILTER'] || nil
|
|
3
3
|
# Services to hide
|
|
4
|
-
|
|
4
|
+
services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',')
|
|
5
|
+
services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) }
|
|
5
6
|
|
|
6
7
|
service_per_node = {}
|
|
7
8
|
services.each do |service_name, tags|
|
|
8
|
-
if !services_blacklist.
|
|
9
|
+
if !services_blacklist.any? {|r| r.match(service_name)}
|
|
9
10
|
service(service_name, tag: service_tag_filter).sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode|
|
|
10
11
|
node_services = service_per_node[snode['Node']['Node']] || []
|
|
11
12
|
node_services.push(snode)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: consul-templaterb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SRE Core Services
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-01-
|
|
11
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: em-http-request
|
|
@@ -154,6 +154,8 @@ files:
|
|
|
154
154
|
- ".ruby_app"
|
|
155
155
|
- ".travis.yml"
|
|
156
156
|
- CHANGELOG.md
|
|
157
|
+
- CODE_OF_CONDUCT.md
|
|
158
|
+
- CONTRIBUTING.md
|
|
157
159
|
- Gemfile
|
|
158
160
|
- LICENSE.txt
|
|
159
161
|
- README.md
|
|
@@ -199,6 +201,7 @@ files:
|
|
|
199
201
|
- samples/consul_template.json.erb
|
|
200
202
|
- samples/consul_template.txt.erb
|
|
201
203
|
- samples/consul_template.xml.erb
|
|
204
|
+
- samples/consul_template_broken.txt.erb
|
|
202
205
|
- samples/criteo/haproxy.cfg.erb
|
|
203
206
|
- samples/criteo_choregraphies.html.erb
|
|
204
207
|
- samples/criteo_choregraphies.txt.erb
|
|
@@ -233,8 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
233
236
|
- !ruby/object:Gem::Version
|
|
234
237
|
version: '0'
|
|
235
238
|
requirements: []
|
|
236
|
-
|
|
237
|
-
rubygems_version: 2.7.7
|
|
239
|
+
rubygems_version: 3.0.2
|
|
238
240
|
signing_key:
|
|
239
241
|
specification_version: 4
|
|
240
242
|
summary: Implementation of Consul template using Ruby and .erb templating language
|