[rudder-users] question about Rudder Variable Uses

Francois Armand francois.armand at normation.com
Sun Mar 11 14:16:29 CET 2018


On 10/03/2018 19:04, Vinoth Kumar wrote:
> Hi Team,
>
> How can I use variables in rudder.
>
> example:
> i want to add contents in a file which is the name of contains 
> hostname of the each server.
>
> like /opt/node1.xml /opt/node2.xml /opt/node3.xml . That means 
> /opt/$HOSTNAME.
>
> In this situation how to use to enforce contents in all server's file 
> using rudder technique.
>
> Thanks in advance,
> vinoth

Hello Vinoth,

You can use ${rudder.node.hostname} in directive parameters to have it 
replaced by the node hostname.
Unfortunatly, there is only a very limited set of properties under 
${rudder.node.*}, see the list here: 
https://www.rudder-project.org/doc-4.2/_variables.html#_system_variables
The feature request is traced in: 
https://www.rudder-project.org/redmine/issues/3112

You can also define any property (string or json) on a node, and get the 
value in directives with ${node.properties[json][path]}. See 
https://www.rudder-project.org/doc-4.2/_node_properties.html

Hope it helps,

-- 


------------------------------------------------------------------------
*François ARMAND*
/Co-founder & CTO/
Normation <http://www.normation.com>
------------------------------------------------------------------------
*87 rue de Turbigo, 75003 Paris, France*
Telephone: 	+33 (0)1 83 62 99 23
Mobile: 	+33 (0)6 63 37 60 55
------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rudder-project.org/pipermail/rudder-users/attachments/20180311/8ef8fecf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo-square.gif
Type: image/gif
Size: 1036 bytes
Desc: not available
URL: <http://www.rudder-project.org/pipermail/rudder-users/attachments/20180311/8ef8fecf/attachment.gif>


More information about the rudder-users mailing list