Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consul 0.6 support #204

Closed
tzz opened this issue Dec 10, 2015 · 4 comments
Closed

Consul 0.6 support #204

tzz opened this issue Dec 10, 2015 · 4 comments

Comments

@tzz
Copy link

tzz commented Dec 10, 2015

I noticed these were missing to support Consul 0.6:

  • update download URLs and default version
  • support tcp checks

Do you need patches for those?

@hopperd
Copy link
Contributor

hopperd commented Dec 10, 2015

The download url should be fixed already along with upgrading via url automatically via #201 and #202

Haven't see anything for tcp checks, so patches welcome for that.

@hopperd
Copy link
Contributor

hopperd commented Dec 10, 2015

Also the default version wasn't adjust to 0.6.0 currently either.

@tzz
Copy link
Author

tzz commented Dec 10, 2015

For the TCP checks, I applied this simple patch (also fixing a message typo). Feel free to use it; it works for me and it's a tiny change.

commit 874c1967993dc6da17881c92a0070e284439a660
Author: Ted Zlatanov <tzz@lifelogs.com>
Date:   Thu Dec 10 12:20:24 2015 -0500

    consul: allow tcp checks

diff --git a/modules/consul/lib/puppet/parser/functions/consul_validate_checks.rb b/modules/consul/lib/puppet/parser/functions/consul_validate_checks.rb
index 7fdd0eb..5772f38 100644
--- a/modules/consul/lib/puppet/parser/functions/consul_validate_checks.rb
+++ b/modules/consul/lib/puppet/parser/functions/consul_validate_checks.rb
@@ -15,7 +15,11 @@ def validate_checks(obj)
           end
         elsif obj.key?("http")
           if (! obj.key?("interval"))
-            raise Puppet::ParseError('http must be defined for interval checks')
+            raise Puppet::ParseError('interval must be defined for http checks')
+          end
+        elsif obj.key?("tcp")
+          if (! obj.key?("interval"))
+            raise Puppet::ParseError('interval must be defined for tcp checks')
           end
         elsif obj.key?("script")
           if (! obj.key?("interval"))

@tzz
Copy link
Author

tzz commented Dec 10, 2015

For the URLs, the #201 and #202 fixes look great.

Changing the default version is up to you, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants