exec has been used to do this since puppet's early days. You can use your 
choice of systems tools (sed, perl, ...)
Then put it into a define, so it can be called on many different file and 
multiple times

Some examples:
http://projects.puppetlabs.com/projects/1/wiki/simple_text_patterns
https://github.com/puppet-modules/puppet-common/blob/master/manifests/defines/replace.pp

Also found a module for editing files. I  just found it and have not used it, 
so no idea how well it works
https://github.com/mstrauss/puppet-editfile

Steven

Date: Sat, 9 Mar 2013 23:55:50 +0200
Subject: [Puppet Users] inplace line manipulation
From: [email protected]
To: [email protected]

Hi Everybody, I'm searching for a way to manipulate file lines using patterns 
i.e. existing patterns is git+ssh://[email protected]/User/Repo.git and i want to 
change its occurrence to git+http://user_name:[email protected]/User/Repo.git
I've checked file_line{} resource in puppetlabs stdlib, but actually it didn't 
fit my case
so can any one recommend any other way rather than templating this file
Thanks in advance 
-- 
Best Regards, 
Eslam Mamdouh El Husseiny
Systems Administrator

Cloud Niners Ltd.

Cellular: (+2) 011 198 40 40

Mansoura: (+2) 050 234 70 81
Cairo:    (+2) 022 268 34 60
Fax:      (+2) 022 268 34 63








-- 

You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.

For more options, visit https://groups.google.com/groups/opt_out.

 

 
                                          

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to