On Tue, May 28, 2013 at 9:56 AM, James Cammarata <[email protected]> wrote:

> Yes, I still need to write a snippet (or modify the existing one) to do
> the static routes. If you write that yourself feel free to share it.
> On May 28, 2013 9:48 AM, "Rainer Duffner" <[email protected]> wrote:
>
>> Am Tue, 28 May 2013 09:04:42 -0500
>> schrieb James Cammarata <[email protected]>:
>> Adding static routes still does not work.
>> Is this expected, given that I don't see anything written out by the
>> relevant section in the post_install_network_config_deb?
>>
>> This is really all I would need to get a system bootstrapped....
>>
>
Actually, most of the framework was in the post snippet, this should work:

diff --git a/snippets/post_install_network_config_deb
b/snippets/post_install_network_config_deb
index 00769fb..01548b6 100644
--- a/snippets/post_install_network_config_deb
+++ b/snippets/post_install_network_config_deb
@@ -179,20 +179,20 @@ echo "   mtu $mtu" >> /etc/network/interfaces
         #for $route in $static_routes
             #set routepattern = $re.compile("[0-9/.]+:[0-9.]+")
             #if $routepattern.match($route)
-                #set $routebits = $route.split(":")
                 #set [$network, $router] = $route.split(":")
+echo "   up ip route add $network via $router dev $iname || true" >>
/etc/network/interfaces
             #else
-              #pass
+echo "   # Warning: invalid route: $route" >> /etc/network/interfaces
             #end if
         #end for
         #if $enableipv6 == True
             #for $route in $ipv6_static_routes
                 #set routepattern =
$re.compile("[0-9a-fA-F:/]+,[0-9a-fA-F:]+")
                 #if $routepattern.match($route)
-                    #set $routebits = $route.split(",")
                     #set [$network, $router] = $route.split(",")
+echo "   up ip -6 route add $network via $router dev $iname || true" >>
/etc/network/interfaces
                 #else
-                    #pass
+echo "   # Warning: invalid route: $route" >> /etc/network/interfaces
                 #end if
             #end for
         #end if
_______________________________________________
cobbler mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/cobbler

Reply via email to