Let's say I have this manifest bit in Puppet:
file { "/whatever/file":
notify => Exec["some_script"]
}
Is there a way to get "/whatever/file" from "some_script"? Or in other words, how can I get the name of a resource that notifies another from the notified one?
The use case is this: we're using git to track changes in /etc, and I'd like Puppet to auto-commit the files that I modify from a manifest. For that, I will use a "exec" resource that is notified by each "file" resource that modifies files in /etc. But I need to know which file was modified to commit only that, and avoid doing a blind "commit -a".
Of course, if there's a better way to do this, I'm open to suggestions.