[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strategy for "one-off" tasks

From: Allen Bettilyon
Subject: Re: Strategy for "one-off" tasks
Date: 11 Jul 2003 16:49:17 -0600

For this example, I would write a static-routes config file that listed
all the needed routes, and than write a second script than maintained
the routes.  In fact, I am doing exactly that (using red-hats
/etc/sysconfig/static-routes ) method.

For example, I've got an inputs/global.static-routes file that looks
kinda like this:

(Bear in mind, this IS redhat specific... but you should get the idea). 


  hw_class1::             admin_dev = ( eth1 )
  hw_class2::             admin_dev = ( eth0 )
  hw_class3::             admin_dev = ( eth2 )

     route_file = ( /etc/sysconfig/static-routes )

     actionsequence = (


      { $(route_file)
           AppendIfNoSuchLine "$(admin_dev) net netmask gw"
           AppendIfNoSuchLine "$(admin_dev) net netmask gw"

           DefineClasses "newRoutes"

      "/etc/sysconfig/network-scripts/ifup-routes $(admin_dev)"

> One example:
>    We have a bunch of web servers that connect to a farm of database servers
> on the same private subnet, and the connection goes through a load balancer.
> The database servers need a static route set for each web server pointing to
> the load balancer, so the web server will get the reply back from the same
> IP it sent the request to (the load balancer).
>    When we add a new web server, we need to add a route to each database
> server.  Using "AppendIfNoSuchLine" works fine for adding to the init
> script, but we also need to run a shellcomand one-time-only to add the
> route now instead of on the next reboot (which is probably many months
> from now).
> --
> Frank Smith                                             address@hidden
> Systems Administrator                                  Voice: 512-374-4673
> Hoover's Online                                          Fax: 512-374-4501
> _______________________________________________
> Help-cfengine mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]