Hi
I've attached three small patches for post_install_network_config.
0001. Alters my earlier name-servers-search patch and places the code
outside the main loop, since it only needs to run once.
0002. I have been having problems with nameservers in /etc/resolv.conf
not being populated correctly by the magical method that uses DNSn= from
ifcfg-*
So this code specifically added namerservers
0003. I don't think DNSn= should be populated for slave interfaces, this
is a simple if statement to stop this.
These are also up on my github page if you still have the details.
Dave
>From adeca81f13422926afb5ef6ba01e0153c99fe6d8 Mon Sep 17 00:00:00 2001
From: Dave Hatton <[email protected]>
Date: Wed, 25 Feb 2009 09:17:47 +0000
Subject: [PATCH] move name server search path code outside of main loop
---
snippets/post_install_network_config | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/snippets/post_install_network_config
b/snippets/post_install_network_config
index a2fa037..dd52b93 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -213,14 +213,6 @@ echo "BOOTPROTO=dhcp" >> $devfile
#set $nct = $nct + 1
echo "DNS$nct=$nameserver" >> $devfile
#end for
- #if $name_servers_search != ""
-sed -i -e "/^search /d" /etc/resolv.conf
-echo -n "search " >>/etc/resolv.conf
- #for $nameserversearch in $name_servers_search
-echo -n "$nameserversearch " >>/etc/resolv.conf
- #end for
-echo "" >>/etc/resolv.conf
- #end if
#for $route in $static_routes
#set routepattern = $re.compile("[0-9/.]+:[0-9.]+")
#if $routepattern.match($route)
@@ -232,8 +224,18 @@ echo "$network via $router" >> $routesfile
#end if
#end for
#set $i = $i + 1
-# End configuration for $iname
-#end for
+# End configuration for $iname
+ #end for
+ ##
=============================================================================
+ ## Configure name server search path in /etc/resolv.conf
+ #if $name_servers_search != ""
+sed -i -e "/^search /d" /etc/resolv.conf
+echo -n "search " >>/etc/resolv.conf
+ #for $nameserversearch in $name_servers_search
+echo -n "$nameserversearch " >>/etc/resolv.conf
+ #end for
+echo "" >>/etc/resolv.conf
+ #end if
## Move all staged files to their final location
rm -f /etc/sysconfig/network-scripts/ifcfg-*
mv /etc/sysconfig/network-scripts/cobbler/* /etc/sysconfig/network-scripts/
--
1.5.5.6
>From 42e8da8aec4016050aa0007f526f5c475818a4e8 Mon Sep 17 00:00:00 2001
From: Dave Hatton <[email protected]>
Date: Wed, 25 Feb 2009 11:37:14 +0000
Subject: [PATCH] specific code to add nameservers to /etc/resolv.conf
---
snippets/post_install_network_config | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/snippets/post_install_network_config
b/snippets/post_install_network_config
index dd52b93..f71dd64 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -236,6 +236,14 @@ echo -n "$nameserversearch " >>/etc/resolv.conf
#end for
echo "" >>/etc/resolv.conf
#end if
+ ##
=============================================================================
+ ## Configure name server search path in /etc/resolv.conf
+ #if $name_servers_search != ""
+sed -i -e "/^nameserver /d" /etc/resolv.conf
+ #for $nameserver in $name_servers
+echo "nameserver $nameserver" >>/etc/resolv.conf
+ #end for
+ #end if
## Move all staged files to their final location
rm -f /etc/sysconfig/network-scripts/ifcfg-*
mv /etc/sysconfig/network-scripts/cobbler/* /etc/sysconfig/network-scripts/
--
1.5.5.6
>From ffd95a6c8a80e03d441ec4c07498261dda8a043c Mon Sep 17 00:00:00 2001
From: Dave Hatton <[email protected]>
Date: Wed, 25 Feb 2009 14:51:47 +0000
Subject: [PATCH] don't add DNS entries to ifcfg-* for slave interfaces
---
snippets/post_install_network_config | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/snippets/post_install_network_config
b/snippets/post_install_network_config
index f71dd64..dcc239c 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -208,11 +208,14 @@ echo "BOOTPROTO=dhcp" >> $devfile
# If you end up here, please mail the list... This shouldn't
# happen. ;-) -- jcapel
#end if
- #set $nct = 0
- #for $nameserver in $name_servers
- #set $nct = $nct + 1
+ ## If the interface is anything but a slave then add DNSn entry
+ #if $bonding.lower() != "slave"
+ #set $nct = 0
+ #for $nameserver in $name_servers
+ #set $nct = $nct + 1
echo "DNS$nct=$nameserver" >> $devfile
- #end for
+ #end for
+ #end if
#for $route in $static_routes
#set routepattern = $re.compile("[0-9/.]+:[0-9.]+")
#if $routepattern.match($route)
--
1.5.5.6
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler