Skip to content

(MODULES-1982)Create a tcp_conn_validator resource #444

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

Closed
wants to merge 1 commit into from

Conversation

Spredzy
Copy link
Contributor

@Spredzy Spredzy commented Apr 27, 2015

Some services might take a while to start, even though the service
returned the boot process is finish, the process is not yet actually
listening on the port. This resource would allow to ensure a service is
really up and running before continuing with the application of the
catalog. Other project already rely on a similar feature. [1][2]

[1]
https://github.com/puppetlabs/puppetlabs-mongodb/blob/master/lib/puppet/type/mongodb_conn_validator.rb
[2]
https://github.com/puppetlabs/puppetlabs-puppetdb/blob/master/lib/puppet/type/puppetdb_conn_validator.rb


module Puppet
module Util
class TcpValidator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you're putting this into the puppet::util namespace, rather than just creating our own?
it kinda feels… dirty…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to move that to lib/puppetx/puppetlabs, as per https://github.com/puppetlabs/puppet/blob/master/lib/puppet_x.rb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidS so you want this function to be in PuppetX::Util::TcpValidator scope ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The puppet_x.rb suggests to use puppetx/moduleowner as namespace. PuppetX::Puppetlabs::TcpValidator would sound good to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that should have been puppet_x/moduleowner

@Spredzy Spredzy force-pushed the tcp_conn_validator branch 2 times, most recently from d6c326d to 876340c Compare May 4, 2015 07:37
@Spredzy
Copy link
Contributor Author

Spredzy commented May 4, 2015

@DavidS PR updated to reflect the namespace change. Is that ok? Should the path to the TcpValidator class should be change or is it fine as it is?

@DavidS
Copy link
Contributor

DavidS commented May 4, 2015

Uhm, yeah, that would be great. File names should almost always match their contents.

@Spredzy Spredzy force-pushed the tcp_conn_validator branch from 876340c to cc16fee Compare May 4, 2015 07:57
@Spredzy
Copy link
Contributor Author

Spredzy commented May 4, 2015

@DavidS done.

Some services might take a while to start, even though the service
returned the boot process is finish, the process is not yet actually
listening on the port. This resource would allow to ensure a service is
really up and running before continuing with the application of the
catalog. Other project already rely on a similar feature. [1][2]

[1]
https://github.com/puppetlabs/puppetlabs-mongodb/blob/master/lib/puppet/type/mongodb_conn_validator.rb
[2]
https://github.com/puppetlabs/puppetlabs-puppetdb/blob/master/lib/puppet/type/puppetdb_conn_validator.rb
@Spredzy Spredzy force-pushed the tcp_conn_validator branch from cc16fee to 07beae4 Compare May 4, 2015 13:07
@nibalizer
Copy link
Contributor

We're thinking a new module for this, discussion: https://groups.google.com/forum/#!topic/puppet-dev/5hZcxDk6pjk

prevent configuration changes from being applied if the server cannot be
reached, but it could potentially be used for other purposes such as monitoring."

ensurable do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this resource doesn't really have an actual "state" I don't think it should be ensurable - having something like a "reachable => true/false" seems like a better approach to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would reachable => false, mean 'make sure this thing is down before proceeding?'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, either those are the semantics or remove this sort of "ensurable" or "reachable" parameter entirely and indicate that this check must always pass. As it stands, I think that this resource will fail regardless of if it's present or absent.

@nibalizer
Copy link
Contributor

Can you submit this to puppetcommunity/puppet-healthcheck?

@Spredzy
Copy link
Contributor Author

Spredzy commented May 20, 2015

@nibalizer will do. Will catch up with the thread in the ML also.

@puppet-community-ci
Copy link

The result of the test was: PASS
Details at http://planck.nibalizer.com/buildlogs//puppetlabs+puppetlabs-stdlib+444+1432863542+PASS

I am a beta ci bot. I am probably lying to you.
You can contact nibalizer for more details

@puppet-community-ci
Copy link

The result of the test was: PASS
Details at http://planck.nibalizer.com/buildlogs/puppetlabs+puppetlabs-stdlib+444+1432896427+PASS

I am a beta ci bot. I am probably lying to you.
You can contact nibalizer for more details.

@puppet-community-ci
Copy link

The result of the test was: PASS
Details at http://ci.puppet.community/buildlogs/puppetlabs+puppetlabs-stdlib+444+1432999885+PASS

I am a beta ci bot. I am probably lying to you.
You can contact nibalizer for more details.

@Spredzy
Copy link
Contributor Author

Spredzy commented May 30, 2015

As asked by @nibalizer and announced in the thread on puppet-dev this PR has been made against puppet-community/puppet-healtcheck module voxpupuli/puppet-healthcheck#1

Closing it here.

@Spredzy Spredzy closed this May 30, 2015
@igalic
Copy link
Contributor

igalic commented Jun 1, 2015

\o/

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

Successfully merging this pull request may close these issues.

6 participants