Puppet: Failed to create backup <file>: Received new content for amount
I had a question that I was hoping someone would have an answer to. Essentially, I try to always use a fixed, slightly older version of phpunit, which I put in my module file resources.
manifesto:
file { "/usr/bin/phpunit": ensure => file, owner => 'root', group => 'root', mode => 0755, source => "puppet:///modules/php/phpunit" } Preparation: I download the current ("wrong") version of phpunit and put it in / usr / bin.
So, the first victorious puppet succeeds:
Notice: Compiled catalog for <hostname> in environment production in 3.06 seconds Notice: /Stage[main]/Php/File[/usr/bin/phpunit]/content: content changed '{md5}9f61f732829f4f9e3d31e56613f1a93a' to '{md}38789acbf53196e20e9b89e065cbed94' Notice: /Stage[main]/Httpd/Service[httpd]: Triggered 'refresh' from 1 events Notice: Finished catalog run in 15.86 seconds Then I download the current (still "wrong") version of phpunit and put it in / usr / bin again.
This time the puppet is failing.
Notice: Compiled catalog for <hostname> in environment production in 2.96 seconds Error: Could not back up /usr/bin/phpunit: Got passed new contents for sum {md5}9f61f732829f4f9e3d31e56613f1a93a Error: Could not back up /usr/bin/phpunit: Got passed new contents for sum {md5}9f61f732829f4f9e3d31e56613f1a93a Error: /Stage[main]/Php/File[/usr/bin/phpunit]/content: change from {md5}9f61f732829f4f9e3d31e56613f1a93a to {md5}38789acbf53196e20e9b89e065cbed94 failed: Could not back up /usr/bin/phpunit: Got passed new contents for sum {md5}9f61f732829f4f9e3d31e56613f1a93a What gives? If I delete the file (/ var / lib / puppet / clientbucket / 9 / f / 6/1 / f / 7/3/2 / 9f61f732829f4f9e3d31e56613f1a93a /) from my file, it will work again ... for the next run, but not after that.
What am I doing wrong?
I would be grateful for any materials and thanks in advance.
This has no other solution than updating it, as in some versions of puppets there is an error when files containing both UTF8 and binary characters are not processed correctly, and this leads to an error message.
https://tickets.puppetlabs.com/browse/PUP-1038
A badly complicated solution that I used as a workaround is to have a .tar file in a file resource that notifies exec, which decompresses and places the actual executable in the correct directory, making sure the timestamp for the latter is newer than the former.
This is far from ideal, but it works in cases like mine, where upgrading a puppet to the latest version is not an attractive option.
There was also a mistake. I solved this with a combination of the two previous answers.
First, I had to remove / var / lib / puppet / clientbucket on the client node by doing:
sudo rm -r /var/lib/puppet/clientbucket Just doing this will only result in a restart.
Then I had to mark backup => false, to stop it from being recreated, skipping any step, I could not solve it. The accepted answer is incorrect, saying that there is
"there is no solution but an update."