I'm trying to write a puppet module that writes a templated config out but
onlyif it's the stock config from the RPM (so as to not screw with any formatting they have going on). The rest of config management is done through augeas. Previously this worked but for some reason
rpm -Vf isn't printing that smb.conf does indeed vary from when it was first installed. For example, I've made heavy changes to it and its timestamp yet:
[root@vlmat ~]# rpm -Vf /etc/samba/smb.conf [root@vlmat ~]# echo $? 0
Doesn't reflect that the md5sum as changed at all nor does it change the return code.
And smb.conf is in the rpm database but verifying the whole package doesn't yield anything:
[root@vlmat ~]# rpm -qf /etc/samba/smb.conf samba-common-3.6.23-35.el6_8.x86_64 [root@vlmat ~]# rpm -V samba-common [root@vlmat ~]#
After editing another config file in that rpm:
[root@vlmat ~]# rpm -V samba-common S.5....T. c /etc/sysconfig/samba
The SHA256 sum does differ from what the database has:
[root@vlmat ~]# rpm -ql --dump samba-common | grep smb /etc/samba/smb.conf 9778 1461617087 2474992be3adf11ef60aa754151f19b5756aaf9919cd6eacbd3f6b75c303dbb1 0100644 root root 1 0 0 X [...snip..] [root@vlmat ~]# sha256sum /etc/samba/smb.conf 270cd0ca5bce64448c31dc6c8e01d12f3d1217b8c208008a1dd1ddc976714774 /etc/samba/smb.conf
I seem to remember this method working before, but not sure what could have changed.
I've worked around the issue by having a bash script copy the template over if the sha256 checksum on the file and in the DB are the same but I'd like an explanation/workaround for the above method since I think it should work. Why does it see the change to one config file but not the one I was looking at?