Issue #7680 has been updated by Andrew Parker.
I was pinged about this and took a look into the proposed fix. I only looked into it far enough to understand why this seems to fix the problem, but have not looked into whether this regresses on anything else. The change that is proposed is to make `metadata.links == :manage` change to `resource[:links] == :manage`. What is going on here is that the `metadata` object is the response from the puppet master from the metadata request. So what is the `links` method on that? Well it appears that that method is actually a portion of the request to the master for the file metadata. Specifically, I think it controls whether or not the *master* should be following links (this is a bit of conjecture since the code was difficult to follow). In the request that the file provider does, this will always be set to `:manage`. The code as it stands will then always skip copying the source data whenever the file type is `"link"`, no matter what the `:links` parameter has been set to. In that case, I think the patch might be correct. We need to just make sure that the code that was being skipped before the patch (because of the `next` call) has no unwanted consequences. Once that is checked, tests are fixed up, then we should be able to take this fix. However, I think there is a question as to how the metadata is supposed to play into this. I may not be understanding the server side of that interaction correctly and maybe the agent should be sending its `:links` parameter along with the metadata request, in which case it can use the `metadata.links` way that it does right now. I think this gets into the file servers handling of symbolic links and whether or not it should follow them or not and when. I think this gets into #12418. ---------------------------------------- Bug #7680: Checksum missmatch when copying followed symlinks https://projects.puppetlabs.com/issues/7680#change-87008 Author: Mikael Svantesson Status: Code Insufficient Priority: Normal Assignee: Category: file Target version: Affected Puppet version: 2.6.8 Keywords: symlink file Branch: https://github.com/puppetlabs/puppet/pull/1476 When trying to copy a file (using a symlink), Puppet does not calculate the correct checksum for the temporary file. This work in 2.6.7, I have not tried 2.7.x. **Error:** err: /Stage[pre]/Sudo/File[/etc/sudoers]/ensure: change from absent to present failed: Could not rename temporary file /etc/sudoers.puppettmp_4293 to /etc/sudoers: File written to disk did not match checksum; discarding changes ( vs {md5}d41d8cd98f00b204e9800998ecf8427e) at /etc/puppet/modules/sudo/manifests/init.pp:12 at /etc/puppet/modules/sudo/manifests/init.pp:12 **Manifest:** class sudo { package { 'sudo': ensure => installed } file { '/etc/sudoers': ensure => file, source => ["puppet:///modules/sudo/sudoers-${hostname}", 'puppet:///modules/sudo/sudoers'], links => follow, replace => true, owner => 'root', group => 'root', mode => '0440', } } **File structure:** modules/sudo/files |-- sudoers |-- sudoers-host1 `-- sudoers-host2 -> sudoers-host1 -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
