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 comment in manage_unit deployed files #333

Merged
merged 1 commit into from Jun 15, 2023

Conversation

traylenator
Copy link
Contributor

Pull Request (PR) description

It's useful to see clearly see that files deployed with puppet are deployed with puppet.

Add a comment to top of files deployed by systemd::manage_unit and systemd::manage_dropin.

e.g

systemd::manage_unit{'redis@.service':
  ensure          => present,
  unit_entry    => {
    'Description' => 'redis server instance on port %i',
   },
  service_entry => {
    'Type'      => 'simple',
    'User'      => 'redis',
    'Group'     => 'redis',
    'ExecStart' => '/usr/bin/redis-server /etc/redis/redis_%i.conf',
    'ExecStop'  => '/usr/bin/redis-cli -p %i shutdown',
    'PIDFile'   => '/run/redis/%i.pid',
  },
}

will now deploy /etc/systemd/system/@redis@.service with a first line of:

# Deployed with puppet

@traylenator traylenator force-pushed the macros branch 2 times, most recently from 5b4fda8 to c9582bd Compare April 22, 2023 21:25
@traylenator
Copy link
Contributor Author

We could put the comment as an additional description:

[Unit]
Docs=This unit is at least partially manged by puppet

And it would show up in a status, something like:

$ systemctl status sshd
○ sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
       Docs: man:sshd(8)
             man:sshd_config(5)
             This unit is at least partially manged by puppet
            

cool but probably a bit intrusive.

@traylenator
Copy link
Contributor Author

If possible and then I'll make a release.

@bastelfreak
Copy link
Member

I would be fine with a comment or a description, whatever you prefer.

@traylenator
Copy link
Contributor Author

Morning,
I think stick with the comment as is. If we add to the description it gets ambiguous when the description is reset with an '' value.

It's useful to see clearly see that files deployed with puppet
are deployed with puppet.

Add a comment to top of files deployed by `systemd::manage_unit`
and  `systemd::manage_dropin`.
@traylenator traylenator merged commit c647a4c into voxpupuli:master Jun 15, 2023
17 checks passed
@traylenator traylenator deleted the macros branch June 15, 2023 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants