graylog-labs / graylog2-puppet

[DEPRECATED] Puppet module to install and manage a Graylog 1.x system.
https://www.graylog.org/
MIT License
10 stars 28 forks source link

Support for Graylog 1.1 #26

Closed linuxprofessor closed 9 years ago

linuxprofessor commented 9 years ago

Support for Graylog 1.1

bernd commented 9 years ago

@linuxprofessor Thank you very much for the PR.

I would like to keep backwards compatibility with 1.0 and suggest to keep the mongodb_host and mongodb_port options.

We can build the new mongodb_hosts option from them if they are in use. Also, when they are in use we can log a warning that these options are deprecated.

What do you think?

linuxprofessor commented 9 years ago

Could do that, yes. Is there a good way to determine which Graylog version that's used without the user specifying it? If graylog2::repo is used it's trivial, but I don't suppose one can count on everyone using it?

linuxprofessor commented 9 years ago

I've re-added support for v1.0 and updated README.md a bit.

Thinking about mongodb_replica_set, as it has totally different meanings if you're running the deprecated configuration method or the newer mongodb_uri method. Right now the content of that variable should be a number of hosts/ports in the old method and a replica set name in the new one. Can I leave it like this, or should they be separated?

bernd commented 9 years ago

Thanks for the updates. Good point with the replica set setting. I will think about that.

bernd commented 9 years ago

@linuxprofessor Thanks for you hard work! I merged it and will test a bit and then decide what to do with the replica set issue.

bernd commented 9 years ago

@linuxprofessor What do you think about just adding a mongodb_uri config option and deprecating the rest?

linuxprofessor commented 9 years ago

@bernd that would be alright, can prior versions handle mongodb_uri?

bernd commented 9 years ago

that would be alright, can prior versions handle mongodb_uri ?

No, older versions don't know about that. My idea is as follows.

Using mongodb_uri will add the mongodb_uri setting to the server config.

class { 'graylog::server':
  mongodb_uri => 'mongodb://localhost/graylog',
}

Using the old options like mongodb_database and mongodb_host etc. will just write those (deprecated) options to the server config.

class { 'graylog::server':
  mongodb_database => 'graylog',
  mongodb_host     => 'localhost',
}

Usage of any of the deprecated options will trigger a warning in the puppet log.

linuxprofessor commented 9 years ago

Go for it, seems reasonable.