From cec95b14f02b22f4edd6344a634cbd3a93e7bf39 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Mon, 7 Oct 2024 17:12:21 -0600 Subject: [PATCH 1/4] Update default warewulfd port to match initial configuration We've been shipping a warewulf.conf that defines the warewulfd port as 9873, and a firewalld service that uses this port as well; but the default value in the YAML data-structure has been 9983. This changes the default port to 9873 to match the configuration we've been shipping, and removes the port from the initial configuration file (to use the default value). Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 1 + docs/man/man5/warewulf.conf.5 | 2 +- etc/warewulf.conf | 1 - internal/pkg/config/buildconfig.go.in | 2 +- internal/pkg/config/root_test.go | 6 +++--- overlays/debug/internal/debug_test.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb19f02..f1c7a687 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Changed `wwctl server` to use "INFO" for send and receive logs #725 - Remove a 3-second sleep during iPXE boot. #1500 - Don't package the API in RPM packages by default. #1493 +- Update default `warewulfd` port to match shipped configuration. #1448 ### Removed diff --git a/docs/man/man5/warewulf.conf.5 b/docs/man/man5/warewulf.conf.5 index 3b21ec9e..78716a41 100644 --- a/docs/man/man5/warewulf.conf.5 +++ b/docs/man/man5/warewulf.conf.5 @@ -62,7 +62,7 @@ This is the port that the Warewulf web server will be listening on. It is recommended not to change this so there is no misalignment with node's expectations of how to contact the Warewulf service. -Default: 9983 +Default: 9873 .IP .TP diff --git a/etc/warewulf.conf b/etc/warewulf.conf index a9afbccb..ec46e59b 100644 --- a/etc/warewulf.conf +++ b/etc/warewulf.conf @@ -3,7 +3,6 @@ ipaddr: 10.0.0.1 netmask: 255.255.252.0 network: 10.0.0.0 warewulf: - port: 9873 secure: false update interval: 60 autobuild overlays: true diff --git a/internal/pkg/config/buildconfig.go.in b/internal/pkg/config/buildconfig.go.in index c0368564..560afccd 100644 --- a/internal/pkg/config/buildconfig.go.in +++ b/internal/pkg/config/buildconfig.go.in @@ -38,7 +38,7 @@ type TFTPConf struct { // WarewulfConf adds additional Warewulf-specific configuration to // BaseConf. type WarewulfConf struct { - Port int `yaml:"port" default:"9983"` + Port int `yaml:"port" default:"9873"` Secure bool `yaml:"secure" default:"true"` UpdateInterval int `yaml:"update interval" default:"60"` AutobuildOverlays bool `yaml:"autobuild overlays" default:"true"` diff --git a/internal/pkg/config/root_test.go b/internal/pkg/config/root_test.go index 7d185fdf..38104ffd 100644 --- a/internal/pkg/config/root_test.go +++ b/internal/pkg/config/root_test.go @@ -10,7 +10,7 @@ import ( func TestDefaultRootConf(t *testing.T) { conf := New() - assert.Equal(t, 9983, conf.Warewulf.Port) + assert.Equal(t, 9873, conf.Warewulf.Port) assert.True(t, conf.Warewulf.Secure) assert.Equal(t, 60, conf.Warewulf.UpdateInterval) assert.True(t, conf.Warewulf.AutobuildOverlays) @@ -155,8 +155,8 @@ func TestCache(t *testing.T) { confOrig := New() confCached := Get() - assert.Equal(t, 9983, confOrig.Warewulf.Port) - assert.Equal(t, 9983, confCached.Warewulf.Port) + assert.Equal(t, 9873, confOrig.Warewulf.Port) + assert.Equal(t, 9873, confCached.Warewulf.Port) confOrig.Warewulf.Port = 9999 assert.Equal(t, 9999, confCached.Warewulf.Port) diff --git a/overlays/debug/internal/debug_test.go b/overlays/debug/internal/debug_test.go index eb396122..046bb48b 100644 --- a/overlays/debug/internal/debug_test.go +++ b/overlays/debug/internal/debug_test.go @@ -172,7 +172,7 @@ data from other structures. ### Warewulf -- Port: 9983 +- Port: 9873 - Secure: true - UpdateInterval: 60 - AutobuildOverlays: true From aad9b3490607b7fc949e9b38b932d3a905cf2f83 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Tue, 8 Oct 2024 12:40:37 -0600 Subject: [PATCH 2/4] Refer to nodes.conf as a "registry" rather than "database" Signed-off-by: Jonathon Anderson --- userdocs/contents/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userdocs/contents/configuration.rst b/userdocs/contents/configuration.rst index 37c7e3b0..1da6f70d 100644 --- a/userdocs/contents/configuration.rst +++ b/userdocs/contents/configuration.rst @@ -178,7 +178,7 @@ The first listed key type is used to generate authentication ssh keys. nodes.conf ========== -The ``nodes.conf`` file is the primary database file for all compute +The ``nodes.conf`` file is the primary registry for all compute nodes. It is a flat text YAML configuration file that is managed by the ``wwctl`` command, but some sites manage the compute nodes and infrastructure via configuration management. This file being flat text From a9b908e339b654f0c7219f6c0c01fccb82c5e49c Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Tue, 8 Oct 2024 13:31:16 -0600 Subject: [PATCH 3/4] Remove "network" parameter from initial warewulf.conf "network" is redundant with ipaddr and netmask. Signed-off-by: Jonathon Anderson --- etc/warewulf.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/warewulf.conf b/etc/warewulf.conf index ec46e59b..ae9203e4 100644 --- a/etc/warewulf.conf +++ b/etc/warewulf.conf @@ -1,7 +1,6 @@ WW_INTERNAL: 45 ipaddr: 10.0.0.1 netmask: 255.255.252.0 -network: 10.0.0.0 warewulf: secure: false update interval: 60 From ad7582692cbb28f7a5bfa7d35d35a3433c86bd32 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Tue, 8 Oct 2024 13:38:46 -0600 Subject: [PATCH 4/4] Omit the wwclient section from warewulf.conf if empty Signed-off-by: Jonathon Anderson --- internal/pkg/config/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/config/root.go b/internal/pkg/config/root.go index 5e6b1d9d..b34f958c 100644 --- a/internal/pkg/config/root.go +++ b/internal/pkg/config/root.go @@ -41,7 +41,7 @@ type RootConf struct { SSH *SSHConf `yaml:"ssh,omitempty"` MountsContainer []*MountEntry `yaml:"container mounts" default:"[{\"source\": \"/etc/resolv.conf\", \"dest\": \"/etc/resolv.conf\"}]"` Paths *BuildConfig `yaml:"paths"` - WWClient *WWClientConf `yaml:"wwclient"` + WWClient *WWClientConf `yaml:"wwclient,omitempty"` warewulfconf string }