[Spacewalk-list] Config Management Question

Michael Mraka michael.mraka at redhat.com
Fri Nov 12 16:45:10 UTC 2010


Alex Negvesky wrote:
% Hello,
% 
% I am looking to manage static routes through configuration management.
% I need a way to grab the first 3 octets of the network for an
% interface so I can build a route off it. For example "1.2.3.4/24  via
% (|rhn.system.net_interface.ip_address(eth_device)|.1 "  but obviously
% with the subnet of the interface (e.g a
% rhn.system.net_interface.subnet (eth_device) function) instead of the
% full ip address . Is there a way to do this? If not can I request this
% feature? It would be extremely useful for configuration management.

If you want to put it into a shell config which is executed or sourced (e.g
you can use

STATIC_GATEWAY=$(echo {|rhn.system.net_interface.ip_address(eth_device)|} | awk -F. '{print $1"."$2"."$3}').245

which will set STATIC_GATEWAY to X.X.X.245.


% Thanks, Alex

Regards,

--
Michael Mráka
Satellite Engineering, Red Hat




More information about the Spacewalk-list mailing list