Issue #16743 has been updated by eric sorenson.

Status changed from Unreviewed to Closed
Assignee set to eric sorenson

I can understand your use case, but I really think this special-case work would 
add a lot of complexity to puppet that would not be widely useful.

Managed files being overwritten by rpms is generally a bad thing; the .rpmnew 
files exist precisely to leave running configuration in place. If you want to 
incorporate those changes into managed files, you should put them into your 
manifests.
----------------------------------------
Feature #16743: Handle .rpmnew files, particularly for yum repos
https://projects.puppetlabs.com/issues/16743#change-74745

Author: Orion Poplawski
Status: Closed
Priority: Normal
Assignee: eric sorenson
Category: 
Target version: 
Affected Puppet version: 2.7.18
Keywords: rpmnew
yumrepo
Branch: 


I modify the installed yum repos via the yumrepo type.  If the package 
distributing the repo file is updated, it create a .rpmnew file.  In that case 
what I want to happen is to have the .rpmnew file moved into place and then 
have the yumrepo rules applied.  This way upstream changes/fixes are applied 
while keeping my modifications.  I suspect this behavior may be desired for 
other files maintained in a similar way with other puppet types (particularly 
augeas).

I can handle this (clumsily) with exec, but as the documentation notes it would 
be better to handle with a native type.  Since yumrepo doesn't directly specify 
a file to operate this might be tricky.  But perhaps a "rpmnew" parameter that 
takes arguments like "merge" or "remove".  Then if puppet spies a .rpmnew file 
containing a repo name that it manages it could take the appropriate action.

Currently I'm doing:
    # Move repo.rpmnew files into place so they can be modified
    exec { 'yum.repo.rpmnew.move':
      command => 'for x in *.repo.rpmnew; do test -f $x && mv $x ${x/.rpmnew} 
|| :; done',
      cwd => '/etc/yum.repos.d',
      provider => 'shell',
      onlyif => 'test -f `echo /etc/yum.repos.d/*.repo.rpmnew | cut -d" " -f1`',
    }


But this also has the downside that the exec is processed after the yumrepo 
commands in a run and the changes to the repo take place on the second run.  I 
suppose I need a trigger in there somewhere.


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to