Joey Boggs
2009-Feb-27 15:33 UTC
[Ovirt-devel] [PATCH server] cobbler-import cleanup part 1
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
Jason Guiditta
2009-Mar-04 15:50 UTC
[Ovirt-devel] [PATCH server] cobbler-import cleanup part 1
ACK, this worked fine for me On Fri, Feb 27, 2009 at 10:33 AM, Joey Boggs <jboggs at redhat.com> wrote:> 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 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090304/050dafe6/attachment.htm>
Joey Boggs
2009-Mar-04 16:04 UTC
[Ovirt-devel] Re: [PATCH server] cobbler-import cleanup part 1
Joey Boggs wrote:> 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] > + } > > } > >pushed