r1991 - Change how the default KARGS is handled. There's now a "default kargs"

61 views
Skip to first unread message

com...@warewulf.lbl.gov

unread,
Jun 3, 2016, 6:47:56 PM6/3/16
to warewul...@lbl.gov
Author: jms
Date: 2016-06-03 15:47:55 -0700 (Fri, 03 Jun 2016)
New Revision: 1991

Modified:
trunk/provision/etc/provision.conf
trunk/provision/lib/Warewulf/Module/Cli/Provision.pm
trunk/provision/lib/Warewulf/Provision.pm
Log:
Change how the default KARGS is handled. There's now a "default kargs"
entry in /etc/warewulf/provision.conf

This will be used for the KARGS value if nothing is set.



Modified: trunk/provision/etc/provision.conf
===================================================================
--- trunk/provision/etc/provision.conf 2016-06-02 20:49:34 UTC (rev 1990)
+++ trunk/provision/etc/provision.conf 2016-06-03 22:47:55 UTC (rev 1991)
@@ -25,3 +25,6 @@
# as the default domain
use localdomain = yes

+# The default kernel arguments to pass to the nodes boot kernel
+default kargs = "net.ifnames=0 biosdevname=0 quiet"
+

Modified: trunk/provision/lib/Warewulf/Module/Cli/Provision.pm
===================================================================
--- trunk/provision/lib/Warewulf/Module/Cli/Provision.pm 2016-06-02 20:49:34 UTC (rev 1990)
+++ trunk/provision/lib/Warewulf/Module/Cli/Provision.pm 2016-06-03 22:47:55 UTC (rev 1991)
@@ -173,6 +173,8 @@
my $self = shift;
my $db = $self->{"DB"};
my $term = Warewulf::Term->new();
+ my $config = Warewulf::Config->new("provision.conf");
+ my $con_kargs = $config->get("default kargs") || "quiet";
my $opt_lookup = "name";
my $opt_bootstrap;
my $opt_vnfs;
@@ -752,8 +754,14 @@
$bootstrap = $bootstrapObj->name();
}
}
- my $kargs = join(" ",$o->kargs()) || "net.ifnames=0 biosdevname=0 quiet";

+ my $kargs;
+ if($o->kargs()) {
+ $kargs = join(" ",$o->kargs());
+ } else {
+ $kargs = $con_kargs;
+ }
+
&nprintf("#### %s %s#\n", $name, "#" x (72 - length($name)));
printf("%15s: %-16s = %s\n", $name, "BOOTSTRAP", $bootstrap);
printf("%15s: %-16s = %s\n", $name, "VNFS", $vnfs);

Modified: trunk/provision/lib/Warewulf/Provision.pm
===================================================================
--- trunk/provision/lib/Warewulf/Provision.pm 2016-06-02 20:49:34 UTC (rev 1990)
+++ trunk/provision/lib/Warewulf/Provision.pm 2016-06-03 22:47:55 UTC (rev 1991)
@@ -174,7 +174,8 @@
{
my ($self, @strings) = @_;
my $key = "kargs";
- my $default = "net.ifnames=0 biosdevname=0 quiet";
+ my $conf = Warewulf::Config->new("provision.conf");
+ my $default = $conf->get("default kargs");
my @return;

if (scalar(@_) > 1) {
@@ -200,9 +201,9 @@

if (@return) {
return(@return);
- } else {
- return($default);
}
+
+ return $default;
}



Jason Stover

unread,
Jun 3, 2016, 6:50:37 PM6/3/16
to warewul...@lbl.gov
I have tested this in a VM setup. The written out PXE files were
changed based on the value in provision.conf (don't forget to run:
wwsh pxe update !!!).

If a value was set on a node object then that value is used instead.

-J
> --
> You received this message because you are subscribed to the Google Groups "Warewulf-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to warewulf-deve...@lbl.gov.
>

Allen, Benjamin S.

unread,
Jun 3, 2016, 8:46:52 PM6/3/16
to warewul...@lbl.gov
Looks good to me, tested it in a VM as well. Commit coming shortly removing the ifrename code.

Ben
Reply all
Reply to author
Forward
0 new messages