Wednesday, August 20, 2014

Puppet is an excellent configuration automation scripting language that is really flexible and effective,

In a puppet manifest if you are not running your script in the default puppet directory you may need to get the current Manifest location where its running from, So this can be easily achieved by embedding a ruby code snippets within the manifest it self. The code will look like the following.

$var1 = inline_template("<%= Dir.pwd %>")

notice ("This Current Location : ${var1}")


The output will look like the following,

Notice: Scope(Class[main]): This Current Location  /home/yasassri/Desktop/QA_Resources/puppet/mySCripts/ascluster
Notice: Compiled catalog for yasassri-thinkpad-t540p.private.wso2.com in environment production in 0.01 seconds
Notice: Finished catalog run in 0.03 seconds
Subscribe to RSS Feed Follow me on Twitter!