Created
May 29, 2013 08:18
-
-
Save vStone/5668751 to your computer and use it in GitHub Desktop.
Dirty augeas from puppet apply hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Use a custom lens to do something. | |
class example::custom { | |
if $::servername { | |
} else { | |
warning("puppet apply runs do not detect the correct lensdir: using dirty hack") | |
$lensdir = inline_template("<%= File.expand_path(File.join(File.dirname(scope.source.file),'../lib/augeas/lenses')) %>") | |
Augeas { | |
load_path => "${lensdir}" | |
} | |
} | |
file {'/tmp/example-custom-test': | |
ensure => 'present', | |
} -> | |
augeas {'example-custom-test': | |
lens => 'Test.lns', | |
incl => '/tmp/example-custom-test', | |
changes => [ | |
'set 01 foobar' | |
], | |
onlyif => "match *[. = 'foobar'] size == 0", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment