-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
manage systemd unit files with camptocamp/systemd #90
Conversation
This should be rebased after #86 got merged |
this effectively reverted #58 |
I am not sure how we should proceed here. One the one side I think it is a good idea to aim for 'only one module for one job' and the camp2camp-systemd module is the most used one, has a good feature set and is heavily tested. On the other side this is a bit anoying because we don't have proper namespacing on the puppetserver side, so we can't easily use other modules with the same name. My personal opinion is that we should stick with the camptocamp module. I would like to get feedback from the other contributors. CC @voxpupuli/collaborators @hunner @eputnam maybe this should be discussed during the module triage (sadly I won't be able to attend :( )? How is this handled in official Puppet(labs) modules? |
I'm not a contrib on this module but I agree that |
I disagree on it being a defacto standard, the one being used by me is eyp/systemd which also has a significant user base and active development (though they are a bit lacking in actually pushing their releases to the forge) |
https://forge.puppet.com/camptocamp/systemd last release is from november 2017 |
oh sorry, google search sent me to a tagged version ... still it only has 5 times more downloads which is imo not significant enough to call it a defacto standard. |
are it still only these two places where the module is used? after a quick grep it seems that way. |
The thing here is that we once discussed in the IRC to manage all units in all of our repos with the camptocamp module. For consistency I would prefer it if all services in our modules are managed the same way. |
I'll admit that I'm still not wild about the camptocamp module, though seems like some improvements have been made recently. FWIW, though, when there was discussion about this, the Puppet party line was that it's not Puppet's job to handle it internally (beyond what's already supported in terms of the service resource) and IIRC, it was suggested to use the camptocamp module. Hunter did do some work in terms of seeing whether it was practical (and could perform well enough) to have Puppet detect changed unit files internally. There's some discussion in, e.g., https://tickets.puppetlabs.com/browse/PUP-3483 I'm not using Puppet either for work or play right now, so haven't been doing any work on this stuff, so won't be in a position to improve the camptocamp module personally, but I do think it makes sense to focus on changing / improving that module vs. other solutions. That said, pulling in the module as a dependency when it's literally just doing one exec or managing one template does seem a little heavy-handed when it's not really adding a ton of value. |
How about making use of https://github.com/puppetlabs/puppetlabs-stdlib#load_module_metadata ? It should be possible to use camptocamp/systemd only if it's on the modulepath and otherwise just use an exec. |
Completely untested, but my proposal to satisfy both camps is something a bit like #169 |
Maybe I haven't read the docs correctly but modulepath is not the same as metadata.json listing |
There is sort of a precedent for something similar in the case of puppet-archive vs puppet-staging ( Also, it is important to distinguish between just the unit service reload and management of the unit file itself. I would prefer being dependent on something else for the reload only (don't use ::systemd::unit_file) Ideally, I would like something like:
This might not be possible. |
@juniorsysadmin load_module_metadata loads the metadata.json of the module you ask it to, not the metadata of the module you call it from. See https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/parser/functions/load_module_metadata.rb#L12 |
Personally I don't like modules that manage systemd unit files. Providing a unit fiile and adding it to systemd should be done by a package. A module should only care about enabling+starting a service. modifying/overriding unit file defaults then should happen at the profile level. I know that packaging is not fancy anymore but it really solves some problems. |
@vinzent I'm with you that actual unit files should live in packaging. That said, there is a use case for overrides (drop ins). For example to manage limits. |
and unfortunately, some stuff comes unpackaged. eg just a tarball :( |
@juniorsysadmin I did find an issue with load_module_metadata. It expects some version of the module to be present. If you don't have any systemd module installed, it will still raise an error. Boo! Not to worry. I wrote a new function we could use instead. :) voxpupuli/puppet-extlib#92 |
Adding conditional use of the module is not a good idea. |
@juliantaylor The paths only have a couple of resources each. If this allows you to continue using the module, I'm a bit surprised you're against it. |
I am not against it and to save me time I should probably just be silent. I would like that one to be the no-module one, but that is in the end up to you. |
The thought of trying to support multiple implementations of a module with the same name makes me uneasy and feels like a bad precedent to be setting. I'd rather that voxpupuli as a whole trying to pick a preferred implementation in these situations and try to normalize its usage across the entire "portfolio". |
I don’t think we’d want to go as far as supporting multiple systemd modules. We should pick one. But I don’t think we should mandate it either. I don’t think it’s fair on our users or on the authors of eyp/systemd especially. (I think there’d be some tipping point if we increased our usage of camptocamp/systemd after which other systemd modules couldn’t continue). Much like many modules have a ‘manage_java’ parameter, I think we want some flag for people who don’t want to or can’t use camptocamp/systemd. The function I added to extlib would allow us to do There probably aren’t too many other cases where I’d see us wanting to use |
remember what i did for puppet/archive and camptocamp/archive? |
manage systemd unit files with camptocamp/systemd
No description provided.