Re: [Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-24 Thread Joachim Schrod
On 04/24/14 06:37, Ian Mortimer wrote: On 04/23/14 18:29, Joachim Schrod wrote: I don't understand why the match regex must match the line value. Your match needs to be: match = '^(% )*/DEFAULTPAPERSIZE \(a4\)', It has to match the line value, otherwise on the next puppet run your

Re: [Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-23 Thread Joachim Schrod
On 04/23/14 07:54, Gabriel Filion wrote: On 22/04/14 08:20 PM, Joachim Schrod wrote: # Ghostscript default paper size file_line { 'Ghostscript A4' : path = '/usr/share/ghostscript/9.05/Resource/Init/gs_init.ps', match = '^% /DEFAULTPAPERSIZE \(a4\)', line =

Re: [Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-23 Thread Ian Mortimer
On 04/23/14 18:29, Joachim Schrod wrote: I don't understand why the match regex must match the line value. Your match needs to be: match = '^(% )*/DEFAULTPAPERSIZE \(a4\)', It has to match the line value, otherwise on the next puppet run your modified line won't match and puppet will insert

[Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-22 Thread Mike Langhorst
There's also the file_line resource that's available with the std lib module, that might work for you as well. On Monday, April 21, 2014 3:25:13 PM UTC-7, Joachim Schrod wrote: Hi, I'm new to Puppet, and also new to Augeas. I want to change a line in a file. In particular, the file is

Re: [Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-22 Thread Kenton Brede
I'm no expert with augeas but after looking at the gs_init.ps file, I don't know of any current lens that could be easily modified to work with it. I agree with Mike, I'd either use file_line or an exec. File_line is part of stdlib. Click on the types tab on this page for an example.

Re: [Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-22 Thread Joachim Schrod
On 04/22/14 18:14, Kenton Brede wrote: I'm no expert with augeas but after looking at the gs_init.ps http://gs_init.ps file, I don't know of any current lens that could be easily modified to work with it. I agree with Mike, I'd either use file_line or an exec. File_line is part of stdlib.

Re: [Puppet Users] Re: Augeas lens to change an arbitrary line in a file?

2014-04-22 Thread Gabriel Filion
On 22/04/14 08:20 PM, Joachim Schrod wrote: # Ghostscript default paper size file_line { 'Ghostscript A4' : path = '/usr/share/ghostscript/9.05/Resource/Init/gs_init.ps', match = '^% /DEFAULTPAPERSIZE \(a4\)', line = '/DEFAULTPAPERSIZE (a4) def' } The