Skipping because no files were changed
I started with this, and it worked sometimes:
augeas {"automaster$name":
context => "/files/etc/auto.master",
changes => $changes,
onlyif => "match map[. = '/$name'] size == 0"
}
In some cases it did not work, saying "Skipping because no files were changed" even though debugging showed that changes were made. This version works all the time:
augeas {"automaster$name":
context => "/files/etc/auto.master",
incl => "/etc/auto.master",
lens => "Automaster.lns",
load_path => "/var/lib/puppet/lib/augeas/lenses",
changes => $changes,
onlyif => "match map[. = '/$name'] size == 0"
}
I'm not yet sure why this happened, but it seems the difference is that in a manifest where augeas is used previously with load_path, that I need to use it here too.