[Ovirt-devel] [PATCH server] cobbler-import cleanup part 1

Joey Boggs jboggs at redhat.com
Fri Feb 27 15:33:54 UTC 2009


This part moves part of the sed functionality from cobbler-import directly into the cobbler manifest for better control of the configuration.
Also removes some of the unnecessary lines that are echoed back that are not even visible to the user.

---
 installer/modules/ovirt/files/cobbler-import |   11 -----------
 installer/modules/ovirt/manifests/cobbler.pp |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/installer/modules/ovirt/files/cobbler-import b/installer/modules/ovirt/files/cobbler-import
index d516c68..752bd85 100644
--- a/installer/modules/ovirt/files/cobbler-import
+++ b/installer/modules/ovirt/files/cobbler-import
@@ -61,21 +61,10 @@ cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \
 cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \
     --name=node5 --mac=00:16:3e:12:34:59 --kopts="ovirt_init=scsi"
 
-# TODO use Augeas 0.3.0 Inifile lens
-sed -i -e "s/^module = authn_denyall.*/module = authn_configfile/" \
-    /etc/cobbler/modules.conf
-sed -i -e "s/^server:.*/server: '192.168.50.2'/" \
-    -e "s/^next_server:.*/next_server: '192.168.50.2'/" \
-    /etc/cobbler/settings
 sed -i -e '/kernel /a \\tIPAPPEND 2' /etc/cobbler/pxe/pxesystem.template
 sed -i -e "s/^ONTIMEOUT.*/ONTIMEOUT oVirt-Node-$node_arch/" \
     /etc/cobbler/pxe/pxedefault.template
 
 service cobblerd restart
 cobbler sync
-cobbler list
 
-set +x
-set +e
-echo "Add new oVirt Nodes as Cobbler systems to make them PXE boot oVirt Node image directly."
-echo "oVirt-Node-$node_arch is also default boot option in Cobbler menu"
diff --git a/installer/modules/ovirt/manifests/cobbler.pp b/installer/modules/ovirt/manifests/cobbler.pp
index ed9f3c9..89b22b1 100644
--- a/installer/modules/ovirt/manifests/cobbler.pp
+++ b/installer/modules/ovirt/manifests/cobbler.pp
@@ -121,7 +121,29 @@ class cobbler::bundled {
         require => [File["/usr/sbin/cobbler-import"],
                    Service["cobblerd"],Package[ovirt-node-image],Package[livecd-tools]]
     }
+        file_replacement{"settings_auth_module":
+                file => "/etc/cobbler/settings",
+                pattern => "module = authn_denyall",
+                replacement => "module = authn_configfile",
+                require => Package[cobbler],
+                notify => Service[cobblerd]
+        }
+
+        file_replacement{"settings_server":
+                file => "/etc/cobbler/settings",
+                pattern => "server: 127.0.0.1",
+                replacement => "server: $mgmt_ipaddr",
+                require => Package[cobbler],
+                notify => Service[cobblerd]
+        }
 
+        file_replacement{"settings_next_server":
+                file => "/etc/cobbler/settings",
+                pattern => "next_server: 127.0.0.1",
+                replacement => "next_server: $mgmt_ipaddr",
+                require => Package[cobbler],
+                notify => Service[cobblerd]
+        }
 
 }
 
-- 
1.6.0.6




More information about the ovirt-devel mailing list