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.  Click on the "types" tab on this page
> for an example.
> 
> https://forge.puppetlabs.com/puppetlabs/stdlib

Thanks to Mike and to you for that hint.
Well, but it doesn't work as I expected.

I use the following resource declaration:

    # 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 error message is

Error: Failed to apply catalog: Validation of File_line[Ghostscript A4] failed: 
When providing a 'match' parameter, the value must be a regex that matches 
against the value of your 'line' parameter at 
/etc/puppet/modules/npc/manifests/commons.pp:30
Wrapped exception:
When providing a 'match' parameter, the value must be a regex that matches 
against the value of your 'line' parameter


According to https://forge.puppetlabs.com/puppetlabs/stdlib; tab Types, it's

match

    An optional regular expression to run against existing lines in the 
file;\nif a match is found, we replace that line rather than adding a new line.
line


I don't understand that error message.

Hopefully, my intent is clear: As long as the default GS paper size
is commented out, I want a replacement of that line with the new line.

According to (my understanding) of stdlib::file_line, that should be the way it 
works:
 -- If the commented-out line is matched, it's substituted by the
    new line.
 -- If it's not matched, the new line is added unless it's present.

That's my interpretation of the documentation. AFAICS, reality beats me.
match wants a line as a result that's the outcome of the change that match
is the solicitor to.

I'd appreciate any hints or explanations what I'm doing wrong.

Best,
        Joachim

FWIW: puppet 3.3.1 on openSUSE. (open)SUSE is abandanoned by / has abandonded
Puppet. The so-called maintainer announced that he was forced to take over the
packages due to a leaving collegue and is looking for a new community-based
maintainer. Nobody stood up. (Not too suprising, deployment management is not
really the realm of laptop-minded developers like many people that we find at
openSUSE. Data-center topics like Puppet doesn't seem to be important there.)
Tickets (even with patches; e.g., by me) are not worked at / acted upon any 
more.

Thus, I would prefer a hint or a direction that works with an older version
of Puppet (3.3.x) as well. If that's not possible, the statement that it works
with 3.5.x is fine as well -- that simply means that we have to check if our
customer's plan to use Puppet is still ok with (open)SUSE, if they will fund
it.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod, Roedermark, Germany
Email: [email protected]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/lj710p%2437r%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to