1 # Creates a systemd tmpfile
5 # @see systemd-tmpfiles(8)
8 # The name of the tmpfile to create
10 # * May not contain ``/``
13 # Whether to drop a file or remove it
16 # The path to the main systemd tmpfiles directory
19 # The literal content to write to the file
21 # * Mutually exclusive with ``$source``
24 # A ``File`` resource compatible ``source``
26 # * Mutually exclusive with ``$limits``
28 define systemd::tmpfile(
29 Enum['present', 'absent', 'file'] $ensure = 'file',
30 Stdlib::Absolutepath $path = '/etc/tmpfiles.d',
31 Optional[String] $content = undef,
32 Optional[String] $source = undef,
34 include systemd::tmpfiles
36 if $name =~ Pattern['/'] {
37 fail('$name may not contain a forward slash "(/)"')
40 $_tmp_file_ensure = $ensure ? {
45 file { "${path}/${name}":
46 ensure => $_tmp_file_ensure,
52 notify => Class['systemd::tmpfiles'],