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

Add Journald support #14

Merged
merged 1 commit into from
Oct 19, 2018
Merged

Conversation

duritong
Copy link
Contributor

Make it possible to manage journald settings

if !empty($journald_settings) {
service{'systemd-journald':
ensure => running,
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we only want to manage journald if settings are passed, or always?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm totally open, I just did an implementation that was the most non-intrusive.

Copy link
Member

Choose a reason for hiding this comment

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

I'd say we might aswell manage it if we're going to.

Copy link
Member

Choose a reason for hiding this comment

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

@duritong can you make the change to always manage it then?

@duritong duritong force-pushed the journald_settings branch 2 times, most recently from 086f52e to 6528a20 Compare January 15, 2017 10:45
@duritong
Copy link
Contributor Author

Ok, I pushed a rebased version that manages the journald service all the time.

@thaiphv
Copy link

thaiphv commented Jul 18, 2017

When can we get this merged?

@trevor-vaughan
Copy link
Contributor

I understand wanting to put all of the systemd subsystems under the systemd module, but the various subsystems really are probably complex enough, with enough non-linear changes, to warrant their own modules.

We forked https://github.com/cristifalcas/puppet-journald over at https://github.com/simp/pupmod-simp-journald to continue on with it, get it updated, and add our tests so I would recommend not adding journald support to the main systemd module.

@ekohl
Copy link
Member

ekohl commented Jul 18, 2017

Given the size of those modules I wonder if a system::journald class would also work.

@trevor-vaughan
Copy link
Contributor

@ekohl The issue isn't the size, it's the fact that the API for journald and systemd settings change independently and a change to either would cause a (potentially breaking) change to the API. You would basically end up with two forks running under this project to keep track of minute changes in either subsystem.

@ekohl
Copy link
Member

ekohl commented Jul 22, 2017

@trevor-vaughan I'm not that familiar with it so I'll let you judge it then.

@raphink
Copy link
Member

raphink commented Aug 9, 2017

@mcanevet what do you think? Should we manage journald (and all its friends eventually) or let other modules do that (like @trevor-vaughan suggested)?

@locknut
Copy link

locknut commented Sep 21, 2017

@raphink Our team is okay with (and prefers) one module for both systemd and journald,

@locknut
Copy link

locknut commented Sep 21, 2017

We've been running @duritong 's journald patch for quite a while. Seeing a strange issue on CentOS 7.4 - when puppet refreshes the systemd-journald service, the agent run silently dies.

EDIT: FYI - this happens when the puppet agent run is launched by cloud-init.

@trevor-vaughan
Copy link
Contributor

@raphink and @mcanevet I would like to point out that both systemd and journald are different subsystems and that an update to the API of one may introduce breaking changes in the module that do not affect the other. As such, I would like to petition again for keeping the two subsystems as separate modules.

@raphink
Copy link
Member

raphink commented Oct 16, 2017

@mcanevet what's your take on this?

@bastelfreak
Copy link
Member

Personally I would be fine to have this PR in this module. Journald is, besides timesyncd, resolved and the actual init systemd, part of the systemd project. I see this module as something that managed the project, not only the init system.

@trevor-vaughan systemd itself (the init system) and systemd-journald have different options In a well designed code, breaking changes in one of those components shouldn't effect the other components, so I don't see an issue here. The module may need a major release to support those changes, but that should only affect this specific component (e.g. journald) and not the rest.

@bastelfreak
Copy link
Member

This module already has support for managing networkd, resolved, timesyncd, so I think managing journald is totally fine as long as the default behavior is to not manage it. @duritong are you still interested in this PR? Can you rebase it?

@trevor-vaughan would you be okay with this?

@bastelfreak bastelfreak added the enhancement New feature or request label Mar 13, 2018
@bastelfreak bastelfreak changed the title Journald settings Add Journald support Mar 13, 2018
@@ -1,7 +1,8 @@
# -- Class systemd
# This module allows triggering systemd commands once for all modules
class systemd (
$service_limits = {}
$service_limits = {},
Copy link
Member

Choose a reason for hiding this comment

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

Those parameters need datatypes


describe 'systemd' do

let(:facts) { {
Copy link
Member

Choose a reason for hiding this comment

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

could you use rspec-puppet-facts instead?

@duritong duritong force-pushed the journald_settings branch 2 times, most recently from a9a8603 to 155b374 Compare March 13, 2018 23:22
@duritong
Copy link
Contributor Author

Sure, if it gives the chance to get it merged...

}
$systemd::journald_settings.each |$option, $value| {
ini_setting{
$option:
Copy link
Member

Choose a reason for hiding this comment

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

interesting format, I haven't seen it this way in the past.

metadata.json Outdated
},
{
"name": "puppetlabs/inifile",
"version_requirement": ">= 1.6.0 <2.0.0"
Copy link
Member

Choose a reason for hiding this comment

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

can you bump the version requirement to < 3.0.0? 2.2.0 is the latest release.

@bastelfreak
Copy link
Member

Hi @duritong, thanks for rebasing it. I found one little issue that needs to be fixed. I'm going to merge this tomorrow unless somebody raises concerns.

@elfchief
Copy link

elfchief commented Sep 9, 2018

Any chance of actually getting this merged?

@trevor-vaughan
Copy link
Contributor

@bastelfreak Arg...sorry that I missed this until now.

You said previously:

The module may need a major release to support those changes, but that should only affect this specific component (e.g. journald) and not the rest.

But this is exactly my issue. In this case, I can't reliably pin on an upper bound because features in two different subsystems can change independently and in potentially breaking changes. This increases the likelihood of forks if someone needs the fixes to the systemd part but can't use the breaking changes in the journald part.

Note that several of the major OS vendors take in subsystem patches at different rates so there is a relatively good chance that the module will end up in this scenario.

It's irritating, but systemd isn't a single thing, it's a big pluggable system that needs to be treated as such.

@bastelfreak
Copy link
Member

@trevor-vaughan so we are testing against a fixed list operating systems, and it is pretty unlikely that for example RHEL 7.6 gets an update to 7.7 that pulls in a breaking change within the journald config. We do not even care about breaking changes within journald, right? As long as it still eats the config we provide. We have support for timesyncd/resolved and it is pretty generic and opt in. I think this pattern would be fine for journald as well. And a breaking change within this module for either the init part or any of the other components would result in another major release, so pinning to an upper version boundary works. Overall I think this would be fine?


@elfchief it cannot be merged because it has merge conflicts (and there is still a little debate going on). If you are interested in this PR, you can checkout the feature branch, rebase it, add a switch to enable/disable the management, like we do it here:
https://github.com/camptocamp/puppet-systemd/blob/10cdeb617478262caf05245f131652fa823fef22/manifests/init.pp#L83

Afterwards we can review it again.

@trevor-vaughan
Copy link
Contributor

@bastelfreak I have no concerns about EL7 updates but I do worry about the same module trying to take care of EL and Ubuntu since they tend to pull in different changes over time.

I suppose that it can always be split in the future if necessary.

@bastelfreak
Copy link
Member

As a side note: We (Vox Pupuli) are currently working on beaker tests no AWS. That will allow us to do acceptance tests within real virtual machines and not only docker instances on travis. My plan is to implement the same for this module, so we know it actually works. If anybody is familiar with the beaker-aws module and wants to help please reach out to me or @dhollinger.

@duritong
Copy link
Contributor Author

I rebased it once again.

@raphink
Copy link
Member

raphink commented Oct 19, 2018

@duritong I'm sorry, I merged db56678 2 days ago and it created a conflict again 😢

@duritong
Copy link
Contributor Author

So I rebased again.

@raphink raphink merged commit 8dffbac into voxpupuli:master Oct 19, 2018
@duritong
Copy link
Contributor Author

/me dancing. thx!

@duritong duritong deleted the journald_settings branch October 22, 2018 20:57
op-ct pushed a commit to op-ct/puppet-systemd that referenced this pull request Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-rebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants