Skip to content

Instantly share code, notes, and snippets.

@h0tw1r3
Created June 10, 2023 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h0tw1r3/b04c8d6432fd6da581e79030627a3f51 to your computer and use it in GitHub Desktop.
Save h0tw1r3/b04c8d6432fd6da581e79030627a3f51 to your computer and use it in GitHub Desktop.
Test single exec to manage systemd unit override with Puppet
exec { 'override-service-unit':
provider => 'shell',
environment => ['SYSTEMD_EDITOR=tee'],
command => 'echo "[Service]\nPrivateTmp=no\n" | script -qefc "systemctl edit nutcracker.service" /dev/null',
unless => '/usr/bin/env systemctl show nutcracker.service --property=PrivateTmp | grep "=no"',
notify => Service['nutcracker'],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment