Last active
December 20, 2015 21:19
-
-
Save raphink/6196548 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Puppet::Type.type(:simpleline).provide(:augeas) do | |
desc "Uses Augeas API to update simple line conffiles" | |
include AugeasProviders::Provider | |
lens { 'Simplelines.lns' } | |
confine :feature => :augeas | |
resource_path do |resource| | |
condition = resource[:condition] ? resource[:condition] : resource[:value] | |
"$target/*[label() != '#comment' and . =~ regex('#{condition}')" | |
end | |
define_aug_method!(:create) do |aug, resource| | |
aug.set("$target/01", resource[:value]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment