Puppet Version: 7.6.0 Puppet Server Version: 2019.8.5 OS Name/Version: Rhel 8 on Agent The customer is facing an issue with managing socket files on his system using the `FILE` resource in his custom module. I have managed to replicate the issue by installing netcat on my VM and creating a .socket file by running:
Not all socket files have this extension but they share the same file type which starts with "S" e.g:
srwxrwxrwx 1 root root 0 Jun 29 11:15 aSocket.sock |
Puppet doesn't seem to know how to handle this type of file and throws an error:
Failed to generate additional resources using 'eval_generate': Cannot manage files of type socket
|
**Customer code:
file { '/root': |
ensure => directory, |
owner => 'root', |
recurse => true, |
recurselimit => '2', |
require => User['root'], |
} |
Steps to replicate: 1. Install netcat 2. Run:
nc -lkU /tmp/aSocket.sock
|
3. Insert the following into
/etc/puppetlabs/code/environments/production/manifests/site.pp |
file {'/tmp': |
ensure => directory, |
owner => root, |
recurse => true, |
}
|
4. Run:
puppet apply -v --noop "/etc/puppetlabs/code/environments/production/manifests/site.pp" |
The only way to currently get around this is to add the file to Ignore parameter but from what I can see, not all files have the .sock extension, the only thing that matches is the file type. Desired Behavior: Handle socket file types Actual Behavior: Throws an error |