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 capability to manage /etc/systemd/*.conf files #232

Closed
micah opened this issue Oct 6, 2021 · 11 comments
Closed

Add capability to manage /etc/systemd/*.conf files #232

micah opened this issue Oct 6, 2021 · 11 comments

Comments

@micah
Copy link

micah commented Oct 6, 2021

While this module does give you the capability to configure some systemd configurations (eg. /etc/systemd/logind.conf), it would be nice if it was able to configure the other configurables available (eg. /etc/systemd/networkd.conf).

I don't know if a generic mechanism would be the way to approach that, or to have specific entry points into the different config files and track them over time, adding them as they appear in systemd versions.

At the moment I see on my system journald.conf, logind.conf, networkd.conf, pstore.conf, resolved.conf, sleep.conf, system.conf, timesyncd.conf, and user.conf.

@traylenator
Copy link
Contributor

I think anything generic would just be a trivial wrapper around puppetlabs-inifile so may as well just use inifile type.
The benefit of having things in this module is the strong validation.

@micah
Copy link
Author

micah commented Oct 6, 2021 via email

@kenyon
Copy link
Member

kenyon commented Oct 6, 2021

Many of those configs can already be managed with this module. See https://github.com/voxpupuli/puppet-systemd/tree/master/manifests where we have journald.pp, logind.pp, networkd.pp, system.pp, and timesyncd.pp.

@micah
Copy link
Author

micah commented Oct 6, 2021 via email

@kenyon
Copy link
Member

kenyon commented Oct 6, 2021

Sounds like that would be something nice to add with a pull request if you need that functionality. I use this module to configure my systems to use systemd-networkd, but didn't need to change anything in /etc/systemd/networkd.conf.

@n3mawashi
Copy link

I think the benefit of this module is to allow hiera to manage most of the data change, which when looking at the mentioned services is the creation of ".d" directories, file creation with content and reload of service. This seems more than just a simple wrapper of the "puppetlabs-inifile" library.

I'm sure that with a little bit of tweeting, we can get systemd::dropin to do the heavy lifting. Is anyone working on a PR for this? If not, I might look to raise one?

@geor-g
Copy link

geor-g commented Jan 15, 2022

@ptiggerdine Can't tell if someone is working on this, but I believe it would be valuable if someone did, and so far no one raised their voice. Therefore, please do. :)

@traylenator
Copy link
Contributor

Since ticket was written , logind.conf , crashcore.conf journald.conf and others are all supported.

Doing each file one file at a time makes sense.

Configuring systemd-X.conf is often more than just doing the file, e.g packages have to be installed , services restarted ,...

Re the networkd.conf for sure open a particular issue.

Can we close this.

@micah
Copy link
Author

micah commented Feb 18, 2022

Thanks, I think this could be closed.

@micah micah closed this as completed Feb 18, 2022
op-ct pushed a commit to op-ct/puppet-systemd that referenced this issue Jun 17, 2022
@derekmpage
Copy link

I really don't understand the logic and decision here to "not" control /etc/systemd/*.conf files.
After all this is the systemd module but we can't configure basic systemd settings.

Then someone goes and does something like this?

https://github.com/voxpupuli/puppet-systemd/blob/master/manifests/system.pp#L8

Technically, I can define any setting in system.conf with this very class, however the was implemented to only consider accounting settings and forces them.

So something like this:

hiera.yaml

---
systemd::manage_accounting: true
systemd::accounting:
    DefaultLimitNOFILE: '1024:262144'

results:

nfo: Applying configuration version '1706563751'
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultCPUAccounting]/ensure: created
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultBlockIOAccounting]/ensure: created
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultMemoryAccounting]/ensure: created
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultTasksAccounting]/ensure: created
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultIOAccounting]/ensure: created
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultIPAccounting]/ensure: created
Notice: /Stage[main]/Systemd::System/Ini_setting[DefaultLimitNOFILE]/value: value changed [redacted sensitive information] to [redacted sensitive information]

Why not make make make control of these files configurable?

manage_system_conf: BOOL
manage_user_conf: BOOL
manage_network_conf: BOOL
...

I would be happy to submit a PR but I don't want to put in the effort if the community does not agree with this module taking control of these files.

Thoughts?

@kenyon
Copy link
Member

kenyon commented Feb 1, 2024

I really don't understand the logic and decision here to "not" control /etc/systemd/*.conf files. After all this is the systemd module but we can't configure basic systemd settings.

@derekmpage there is no such single thing as "/etc/systemd/*.conf". There are files matching that pattern, some of which can be managed with this module. See #232 (comment)

Then someone goes and does something like this?

https://github.com/voxpupuli/puppet-systemd/blob/master/manifests/system.pp#L8

That was added in 2018 with #65. This issue was created in 2021.

Why not make make make control of these files configurable?

manage_system_conf: BOOL
manage_user_conf: BOOL
manage_network_conf: BOOL
...

I would be happy to submit a PR but I don't want to put in the effort if the community does not agree with this module taking control of these files.

Thoughts?

Being able to manage more of system.conf, and systemd in general, sounds like a good enhancement to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants