Git Product home page Git Product logo

Comments (14)

electrical avatar electrical commented on June 25, 2024

Hi,

This is something i still want to solve indeed.
The idea i'm having is to have a default hash with all the values the defaults file has when being installed.
Then i can merge the init_defaults hash with that and overwriting only the values you've specified.

What do you think?

from puppet-elasticsearch.

mrbanzai avatar mrbanzai commented on June 25, 2024

I know that user / group are defaulted in manifests/params.pp, so it would be nice to keep those consistent with the init defaults.

On a related note, how would you recommend keeping the other information consistent as well (such as paths)? Right now, the RPM by default creates a defaults file with paths that align with the package's install locations and such (MAX_MAP_COUNT, HOME_DIR, CONF_DIR, CONF_FILE, WORK_DIR, LOG_DIR, DATA_DIR), so needing to override a single value with the Puppet module requires you to redefine everything.

As much as adding additional dependencies annoys me, perhaps it would be worthwhile to look into using Augeas for defining overrides? It would obviously be possible to keep the packaged defaults in-sync with the Puppet module, but with the ability to install from a specific file, differing defaults across distros, etc. it could be annoying to maintain.

Let me know if I'm over-thinking / over-engineering, or if I'm missing something obvious / simple; otherwise, I might spend some time this weekend seeing if it's a valid approach.

Thanks for the response!

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Hi,

I could set a hash with the current values of the defaults file and write that no matter what.
When you override settings in the the init_defaults hash it merges the 2 hashes so it always has the full variable list including the things you override.
Not sure how future proof that is though.

I think the main downside at the moment is that the init scripting fully depends on variable set in the defaults file.
Without it, it doesn't run correctly.
The defaults file should be something to override settings imho.

Augeas could be a good solution indeed but would like to keep dependencies as minimally as possible.
If having a hash for the defaults file content is unreliable / unmaintainable we could have a look at augeas.

Any idea's?

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Did a bit of digging on the augeas part and it should be doable.
Will see if i can implement something.

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Hi,

Been working on it for a bit and seems to work.
Just working on getting the tests to run on the different distro's ( system tests )

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

These are the main changes: 862d677

from puppet-elasticsearch.

mrbanzai avatar mrbanzai commented on June 25, 2024

That worked absolutely perfectly, and it was resolved much quicker than I would have been able to knock it out. Much appreciated!

As to your previous comments: I absolutely agree that the init script is too dependent on those settings being defined in the sysconfig file. However, these changes at least provide a way for the user to only need to override specific settings, and leave the underlying framework in place. If the initscript does become more intelligent in the future, this patch will still continue to function as desired.

Again, thanks for the quick response! I'll leave the closing of the issue to you, to allow closing it with the master merge.

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Just need to fix the $elasticsearch_user and $elasticsearch_group options so they do get into the defaults file.. otherwise its still useless. ( just a bit less useless with this rewrite of it )

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Found a solution for the last bit. Can you check after I've pushed it?

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Should be fixed now. Can you check it? Cheers.

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Pushed an other fix so it works with older versions ( pre 1.0 ) of augeas.

from puppet-elasticsearch.

mrbanzai avatar mrbanzai commented on June 25, 2024

I'll check it out this morning. Thanks for the quick turnaround!

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

No problem :-)
let me know if you find any weird issues.

from puppet-elasticsearch.

electrical avatar electrical commented on June 25, 2024

Talked via other channels. issue solved.

from puppet-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.