When creating a new file, puppet finds out the default selinux context with matchpathcon but it's not specifying the file type what can lead to use the incorrect context (selinux default context depends on file type) and breaks idempotency.
puppet apply test.pp Notice: Compiled catalog for vmname.example.com in environment production in 0.15 seconds Notice: /Stage[main]/Main/File[/etc/systemd/system/redis.service.d]/ensure: created Notice: Applied catalog in 0.54 seconds
When creating a new file, puppet finds out the default selinux context with matchpathcon but it's not specifying the file type what can lead to use the incorrect context (selinux default context depends on file type) and breaks idempotency.
Notice: Compiled catalog for vmname.example.com in environment production in 0.15 seconds Notice: /Stage[main]/Main/File[/etc/systemd/system/redis.service.d]/ensure: created Notice: Applied catalog in 0.54 seconds
We are still hitting this issue and note that with the next version of selinux-policy that changes default selinux context for symlinks under /etc/httpd, idempotency will be broken for any new file created by puppet-httpd under /etc/httpd/conf.d so i guess it will affect users.
Puppet now creates files with the correct default SELinux context for that type of file. Previously, puppet could create the file with the wrong context, which would not be corrected until the next agent run.