User story #4054
closedSpecial cfengine variables vs. special Rudder variables
Description
I think the $(sys.something) vars of cfengine are a little poor. I've managed to use the crontab technique to do this:
=============================================================================== Welcome to $(sys.fqhost) This system is managed by your Rudder infrastructure The policy was last updated on $(sys.last_policy_update) The operating system flavour is $(sys.flavour) The ip address of eth0 is $(sys.ipv4[eth0]) ===============================================================================
Which will output this:
=============================================================================== Welcome to node.example.org This system is managed by your Rudder infrastructure The policy was last updated on Fri Oct 11 15:03:53 2013 The operating system flavour is ubuntu_12 The ip address of eth0 is 10.0.0.2 ===============================================================================
My proposal would be to introduce special Rudder variables that make all inventory data directly available to techniques.
In that case my motd configuration could look something like this:
=============================================================================== Welcome to $(sys.fqhost) This system is managed by Rudder v.$(rudder.version) The policy was last updated on $(sys.last_policy_update) The operating system flavour is $(rudder.inventory.os.name) $(rudder.inventory.os.version) The network interfaces on this system are $(rudder.inventory.interfaces.str) The ip addresses assigned are $(rudder.inventory.ip.addresses.str)" ===============================================================================
Which will output something like this:
=============================================================================== Welcome to node.example.org This system is managed by Rudder v.2.6.8 The policy was last updated on Fri Oct 11 15:03:53 2013 The operating system flavour is Ubuntu 12.04 The network interfaces on this system are eth0, eth1 The ip addresses assigned are 10.0.0.2, 10.0.0.3 ===============================================================================
This is only an example of implementation and it might be a lot of work, but it would be very useful in my humble opininion. :)
Updated by François ARMAND about 11 years ago
- Status changed from New to 8
That's really nice, and it could already be an update of our existing motd default text.
For the Rudder variable, we already have some, see: https://www.rudder-project.org/foswiki/Development/ContextedVariables https://www.rudder-project.org/doc/_variables.html#_system_variables
But clearly, they are quite poor, and extending them to support all inventory information would be really nice.
Updated by Dennis Cabooter about 11 years ago
How can I use these Rudder variables? I tried this, which doesn't work (they don't expand):
=============================================================================== Welcome to ${node.hostname} This system is managed by your Rudder infrastructure The Rudder node id is ${node.id} The policy was last updated on $(sys.last_policy_update) The operating system flavour is $(sys.flavour) The ip addresses configured are $(sys.ip_addresses) ===============================================================================
Updated by Dennis Cabooter about 11 years ago
As discussed on irc with ncharles and fanf, the rudder vars will not expand on the node, e.g.:
=============================================================================== Welcome to ${sys.fqhost} This node is managed by your Rudder infrastructure The Rudder id of this node is ${rudder.node.id} The policy on this node was last updated on ${sys.last_policy_update} The operating system flavour of this node is ${sys.flavour} The ip addresses configured on this node are ${sys.ip_addresses} ===============================================================================
Updated by Dennis Cabooter about 11 years ago
To be more clear..
This:
=============================================================================== Welcome to ${rudder.node.hostname} This node is managed by your Rudder infrastructure The Rudder id of this node is ${rudder.node.id} The policy on this node was last updated on ${sys.last_policy_update} The operating system flavour of this node is ${sys.flavour} The ip addresses configured on this node are ${sys.ip_addresses} ===============================================================================
Shows this on the node eventually:
=============================================================================== Welcome to ${rudder.node.hostname} This node is managed by your Rudder infrastructure The Rudder id of this node is ${rudder.node.id} The policy on this node was last updated on Fri Oct 11 16:26:03 2013 The operating system flavour of this node is ubuntu_12 The ip addresses configured on this node are 10.0.0.2 ===============================================================================
Updated by Benoît PECCATTE over 9 years ago
- Category set to Web - Config management
Updated by François ARMAND about 8 years ago
Updated by François ARMAND about 8 years ago
- Related to User story #6733: Allow Node properties to be used in directives and ncf techniques added
Updated by François ARMAND about 8 years ago
- Related to User story #3112: Allow to get informations from the node inventory to use them in Directives and ncf techniques added
Updated by François ARMAND about 8 years ago
- Status changed from New to Rejected