The following Puppet manifest is meant for installing a binary and a systemd service description file, for starting the binary as a service, and for restarting the service when either the binary or the service description changes.
class my_module::my_service {
file { '/usr/local/bin/my_service':
notify => Service['my_service'],
owner => root,
group => root,
mode => '500',
ensure => present,
source => 'puppet:///modules/my_module/my_service',
}
file { '/lib/systemd/system/my_service.service':
notify => Service['my_service'],
owner => root,
group => root,
mode => '400',
ensure => present,
source => 'puppet:///modules/my_module/my_service.service',
}
service { 'my_service':
require => [ File['/usr/local/bin/my_service'],
File['/lib/systemd/system/my_service.service'] ],
enable => true,
ensure => running,
provider => systemd,
}
}
When I try to apply it, I receive the following error messages:
Warning: /Stage[main]/My_module::My_service/File[/usr/local/bin/my_service]:
Skipping because of failed dependencies
Notice: /Stage[main]/My_module::My_service/File[/lib/systemd/system/my_service.service]:
Dependency User[root] has failures: true
Warning: /Stage[main]/My_module::My_service/File[/lib/systemd/system/my_service.service]:
Skipping because of failed dependencies
Notice: /Stage[main]/My_module::My_service/Service[my_service]:
Dependency User[root] has failures: true
Warning: /Stage[main]/My_module::My_service/Service[my_service]:
Skipping because of failed dependencies
Where does the dependency on User[root]
arise in this manifest and how can I resolve the resulting problem? (It seems to me that even if the file
s' citations of root
caused an implicit dependency on User[root]
this special user should already exist in any case.)