Re: [Puppet Users] elegant way to hash a line in a file, if present

2015-07-07 Thread Cam Mac
Hi Tom, Thanks for the reply. I hadn't used the 'file' method as I didn't want to create the file if it wasn't there already, only modify it. Sorry I should have said that in my original post. It was this requirement that made it less than straightforward. Cheers, Cam On Tuesday, 30 June 201

Re: [Puppet Users] elegant way to hash a line in a file, if present

2015-06-30 Thread Tom Limoncelli
You'll want to create the file using file{} and then add require => File['/path/to/file'] so that the file is created before Puppet tries to modify it. You can do that with less typing by using the -> operator. For example: file { '/usr/share/X11/xorg.conf.d/glamor.conf': ensure => file,

[Puppet Users] elegant way to hash a line in a file, if present

2015-06-29 Thread Cam Mac
Hi, I wanted to create a recipe for hashing a line in a file (I'd rather hash it than delete it), if the file is present and that particular line is present. I came up with a less than elegant solution and wondered whether someone knows of a better way. The file in question: /usr/share/X11/xorg