From 00ad5db153aa9977311e39e6093ea94fbfa17102 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Wed, 23 Aug 2023 14:16:52 -0600 Subject: [PATCH 1/2] Remove redundant entries from changelog Signed-off-by: Christian Goll --- CHANGELOG.md | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0c7243b..8752c6c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,19 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The primary hostname and warewulf server fqdn are now the canonical name in `/etc/hosts` -- new subcommand `wwctl genconf` is available with following subcommands: - * `completions` which will create the files used for bash-completion. Also - fish an zsh completions can be generated - * `defaults` which will generate a valid `defaults.conf` - * `man` which will generate the man pages in the specified directory - * `reference` which will generate a reference documentation for the wwctl commands - * `warwulfconf print` which will print the used `warewulf.conf`. If there is no valid - `warewulf.conf` a valid configuration is provided, prefilled with default values - and an IP configuration derived from the network configuration of the host -- All paths can now be configured in `warewulf.conf`, check the paths section of of - `wwctl --emptyconf genconfig warewulfconf print` for the available paths. -- Added experimental dnsmasq support. + - Refactored `profile add` command to make it alike `node add`. #658 #659 + - The ifcfg ONBOOT parameter is no longer statically `true`, so unconfigured interfaces may not be enabled by default. (#644) @@ -65,22 +55,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `warwulfconf print` which will print the used `warewulf.conf`. If there is no valid `warewulf.conf` a valid configuration is provided, prefilled with default values and an IP configuration derived from the network configuration of the host + - All paths can now be configured in `warewulf.conf`, check the paths section of of `wwctl --emptyconf genconfig warewulfconf print` for the available paths. + - Added experimental dnsmasq support. -- new subcommand `wwctl genconf` is available with following subcommands: - * `completions` which will create the files used for bash-completion. Also - fish an zsh completions can be generated - * `defaults` which will generate a valid `defaults.conf` - * `man` which will generate the man pages in the specified directory - * `reference` which will generate a reference documentation for the wwctl commands - * `warwulfconf print` which will print the used `warewulf.conf`. If there is no valid - `warewulf.conf` a valid configuration is provided, prefilled with default values - and an IP configuration derived from the network configuration of the host -- All paths can now be configured in `warewulf.conf`, check the paths section of of - `wwctl --emptyconf genconfig warewulfconf print` for the available paths. -- Added experimental dnsmasq support. - Check for formal correct IP and MAC addresses for command line options and when reading in the configurations - Write log messages to stderr rather than stdout. #768 From 7ac2970d8333959b811b83b4bac832852d0f7676 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Wed, 23 Aug 2023 14:18:43 -0600 Subject: [PATCH 2/2] fix warewulf.conf location for wwclient Signed-off-by: Christian Goll --- CHANGELOG.md | 1 + internal/app/wwclient/root.go | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8752c6c6..22fe4306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 file is create and will executed after the `ignition-disks-ww4.service` has finished. Entries in `/etc/fstab` for every file system are created with the `noauto` option. +- wwclient has now a commandline switch for the location of warewulf.conf ## [4.4.0] 2023-01-18 ### Added diff --git a/internal/app/wwclient/root.go b/internal/app/wwclient/root.go index 5af79840..88df49e1 100644 --- a/internal/app/wwclient/root.go +++ b/internal/app/wwclient/root.go @@ -16,8 +16,8 @@ import ( "github.com/coreos/go-systemd/daemon" "github.com/google/uuid" - "github.com/hpcng/warewulf/internal/pkg/pidfile" warewulfconf "github.com/hpcng/warewulf/internal/pkg/config" + "github.com/hpcng/warewulf/internal/pkg/pidfile" "github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/spf13/cobra" "github.com/talos-systems/go-smbios/smbios" @@ -31,14 +31,16 @@ var ( RunE: CobraRunE, SilenceUsage: true, } - DebugFlag bool - PIDFile string - Webclient *http.Client + DebugFlag bool + PIDFile string + Webclient *http.Client + WarewulfConfArg string ) func init() { rootCmd.PersistentFlags().BoolVarP(&DebugFlag, "debug", "d", false, "Run with debugging messages enabled.") rootCmd.PersistentFlags().StringVarP(&PIDFile, "pidfile", "p", "/var/run/wwclient.pid", "PIDFile to use") + rootCmd.PersistentFlags().StringVar(&WarewulfConfArg, "warewulfconf", "", "Set the warewulf configuration file") } @@ -48,9 +50,18 @@ func GetRootCommand() *cobra.Command { return rootCmd } -func CobraRunE(cmd *cobra.Command, args []string) error { +func CobraRunE(cmd *cobra.Command, args []string) (err error) { conf := warewulfconf.Get() - + if WarewulfConfArg != "" { + err = conf.Read(WarewulfConfArg) + } else if os.Getenv("WAREWULFCONF") != "" { + err = conf.Read(os.Getenv("WAREWULFCONF")) + } else { + err = conf.Read(warewulfconf.ConfigFile) + } + if err != nil { + return + } pid, err := pidfile.Write(PIDFile) if err != nil && pid == -1 { wwlog.Warn("%v. starting new wwclient", err)