Project

General

Profile

Actions

User story #4054

closed

Special cfengine variables vs. special Rudder variables

Added by Dennis Cabooter over 10 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
Web - Config management
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

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. :)


Related issues 2 (0 open2 closed)

Related to Rudder - User story #6733: Allow Node properties to be used in directives and ncf techniquesReleased2016-07-20Actions
Related to Rudder - User story #3112: Allow to get informations from the node inventory to use them in Directives and ncf techniquesReleasedFrançois ARMANDActions
Actions #1

Updated by François ARMAND over 10 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.

Actions #2

Updated by Dennis Cabooter over 10 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)
===============================================================================
Actions #3

Updated by Dennis Cabooter over 10 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}
===============================================================================
Actions #4

Updated by Dennis Cabooter over 10 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
===============================================================================
Actions #5

Updated by Benoît PECCATTE almost 9 years ago

  • Status changed from 8 to New
Actions #6

Updated by Benoît PECCATTE almost 9 years ago

  • Category set to Web - Config management
Actions #7

Updated by François ARMAND over 7 years ago

I believe this one is either a duplicate of #3112 or to #6733. So closing it.

Actions #8

Updated by François ARMAND over 7 years ago

  • Related to User story #6733: Allow Node properties to be used in directives and ncf techniques added
Actions #9

Updated by François ARMAND over 7 years ago

  • Related to User story #3112: Allow to get informations from the node inventory to use them in Directives and ncf techniques added
Actions #10

Updated by François ARMAND over 7 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF