Ask Your Question
0

How to apply patch to the text file

asked 2014-02-13 02:54:07 -0500

Adam Ryczkowski gravatar image

Sometimes you need to modify certain system scripts with patches (produced by diff).

Theoretically patch-applying mechanism should be quite handy in puppet, but I failed to find anything for "diff" or "patch" on Puppet Forge.

Is it true, that nobody yet did a general-purpose patch-applying puppet module?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-13 04:28:18 -0500

doc75 gravatar image

If you manage the file with puppet, you just need to update the file in puppet and puppet will do the diff and apply the modification.

I am afraid that with patch you cannot manage the file properly especially if you bring a new machine that has none of the patch applied.

Puppet philopsphy is to describe as much as possible the targeted machine state and not how to reach this state. Therefore managing the file in puppet is normally the "best" approach.

Hope this helps.

edit flag offensive delete link more

Comments

OK. I thought, that when the file is large, it would be more efficient to store patches rather than whole contents. And patches have extra feature that allow to check ...(more)

Adam Ryczkowski gravatar imageAdam Ryczkowski ( 2014-02-13 05:04:37 -0500 )edit

As long as you manage the file with puppet it does not matter if the initial file is compliant or not as it will be overwrittent by puppet. Managing through ...(more)

doc75 gravatar imagedoc75 ( 2014-02-13 06:57:06 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-02-13 02:54:07 -0500

Seen: 889 times

Last updated: Feb 13 '14