On Tuesday, November 27, 2012 4:23:50 PM UTC-6, Yanis Guenane wrote:
Within mycon template I have a variable 'test' that depending if the package was installed from source of from the package will have a different path.
Issue is that the function get_test_path() seems to be done at compile time, so the first time I run it will always result in an erroneous answer. After a second run it will be fine.
To answer the question posed by the thread subject, no, it is not possible to make puppet functions be evaluated by the puppet agent during catalog application. They are always evaluated by the master during catalog compilation.
Any dynamic behavior you want to happen on the agent side must be performed by your resources. Often you don't actually need agent-side dynamism beyond what Puppet already provides, but when you do, you generally need either to use an Exec resource, or to write a custom provider for an existing resource type, or to write a whole custom type / provider pair.
John