Commit Graph

58 Commits

Author SHA1 Message Date
Jonathon Anderson
66450a7dcd Simpler names for overlay methods
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-08-27 22:33:18 -06:00
Christian Goll
6f4fd60d8f refactored overlay class
overlay.GetOverlay(name) returns now an error if the overlay doesn't
exist. This is the most canonical way to act if there is no overlay.
2025-08-27 22:24:31 -06:00
Christian Goll
2c51ca7fff added warewuld configure option
Co-authored-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-07-31 21:47:08 -06:00
Jonathon Anderson
d96744afbd Make DHCP range optional
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-14 23:32:22 -07:00
Jonathon Anderson
4809641ef6 Re-order SSH key types to make ed25519 default
- Fixes: #981

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2025-02-05 23:27:29 -07:00
Jonathon Anderson
c244adc7f6 Performance improvements for overlay build
Rendering overlay templates requires fetching and populating / merging all
other nodes, because overlay templates have access to all cluster node info.
This was previously being done for each template render, but is not being done
once for each render operation and re-used for each template render.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-25 08:48:14 -07:00
Jonathon Anderson
0b00233ab7 Move tstruct.Overlay from wwctl to overlay.InitStruct
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-20 11:12:47 +01:00
Jonathon Anderson
c03dc9436b Add an Overlay type with helper methods
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-20 11:12:47 +01:00
Jonathon Anderson
ac49ecef70 Rename and refactor overlay constructor functions
- Reduces redundancy
- Adds clarity

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-12-20 11:12:47 +01:00
Christian Goll
d5fc7e9320 introduce site overlays
site overlays are place in sysconfdir/overlays and take
precedence over distribution overlays with the same name.

Every `wwctl overlay` command changing overlays will create
an site overlay. distribution overlays can't be deleted or
modified with wwctl.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-12-20 11:12:41 +01:00
Jonathon Anderson
e80c639b11 Convert config to *bool
Supports leaving booleans unspecified in YAML.

Boolean methods allow the templates to continue using previous names for
boolean values.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:48 -07:00
Christian Goll
0dd0317740 replaced errors.Wrap with fmt.Errorf
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-11-07 22:57:29 -07:00
Christian Goll
28a7b9fe84 removed NodeInfo and using NodeConf instead
This is a significant change in the undelying data model!

nodeDb, err := node.New()

will result in a structure which contains the on disk
values. Only

nodeDb.FindAllNodes() or nodeDb.GetNode(id) will give
the nodes with its merged in profiles.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-10-17 13:35:42 -04:00
Jonathon Anderson
15aa081dd1 Move restoration of old umask to a defer
Suggested in comment on PR #941

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-21 22:42:51 -06:00
Christian Goll
a8658c226f emsure that .Paths.Tftpdir."warewulf" is 0755
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-09-21 22:41:08 -06:00
Jonathon Anderson
0b6785f722 Remove specific guidance from wwctl error messages
Guidance to run `wwctl configure dhcp` or `wwctl configure tftp` may be
misleading for sites that are managing these services directly. They are
also too specific, as simply re-running `wwctl configure -a` after
enabling them in the config should also be sufficient.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-09-03 19:40:59 -06:00
xu yang
6212f40e4c Refine wwctl configure error handling
- Closes #1273

Signed-off-by: xu yang <xyang@ciq.com>
2024-09-03 19:40:28 -06:00
Jonathon Anderson
7046c6dc8c Use the first configured ssh key type for authn
Previously, the authentication key was always generated using rsa. Now
it uses the first configured ssh key type.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-05-01 14:27:39 -06:00
Christian Goll
ad6699c110 allow the user to specify ssh key types
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-05-01 14:27:36 -06:00
Christian Goll
24cb00e068 removed doubled entries form conf.Path
tftp.tftproot was also avlailable under paths.tftdir, removed
paths.tftpdir

warewulfconf.datastore was also availbale under
paths.datadir, remove paths.datadir

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-02-16 17:38:34 -07:00
Jonathon Anderson
a1832ad8c1 Complete transfer of Warewulf from HPCng
Warewulf is now being maintained in its own GitHub organization at
github.com/warewulf

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-01-26 21:35:04 -07:00
Christian Goll
4379c4c18d use grub/shim from host system
Also the boot method is now configured globaly as this is
the only way to make sure that unkonwn nodes get the right
stuff

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-01-17 18:02:04 -07:00
Jonathon Anderson
038329ebce Remove ipxe binaries and configure for Rocky Linux
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-12-09 01:29:48 -07:00
Christian Goll
8cbeb25c8b seperate the path for the iPXE binaries
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-12-08 22:38:43 -07:00
Jonathon Anderson
42842aeee1 Format entire source code using make fmt
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2023-10-23 17:56:20 -06:00
Christian Goll
a7df560a30 Add json output for ignition
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-08-21 16:19:13 -06:00
Jonathon Anderson
4622153a82 Support subdirectories in ipxe paths
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
e2e3a90623 Revert some caps changes
Use in templates means these were an accidental interface change.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
8321193645 Refactor and document config/datastructure
Also adjusted case for initialisms (e.g., DHCP, TFTP, NFS).

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
70292276e2 Rename BaseConf.New to BaseConf.Get
Since BaseConf.New could return a cached BaseConf, rather than always
constructing a new struct, I've renamed it to Get to more accurately
reflect its use. A new New() method is called by Get and always
initializes a new struct.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
c461e65a98 Rename pkg/warewulfconf to pkg/config
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Christian Goll
ce43dfa0b7 removed getters as configs must exportable
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-06 10:20:00 +01:00
Christian Goll
377702a179 make the configuration to be based in warewulf.conf
defaults will be se by the Makefile

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-03 16:02:41 +01:00
Christian Goll
78978ad233 added warewulfconf as command line parameter
the environment variable WAREWULFCONF is also recognized

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-03 11:18:49 +01:00
Jonathon Anderson
81c3192988 Fix a grammatical error in a log message 2023-02-02 17:26:26 -07:00
Christian Goll
32ab50f299 make ipxe binary source configureable 2023-01-24 12:11:11 +01:00
Jonathon Anderson
15879eb991 Use node.NewInfo constructor in configure hostfile
Also used in overlay, as I was looking there already.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-11-11 11:42:40 -06:00
Jonathon Anderson
037c456bc4 Correct host overlay processing during configure
wwctl configure hostfile was using the /host/ path twice,
causing it to look in the wrong place for /etc/hosts.ww

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-11-11 10:56:07 -06:00
Jonathon Anderson
0b3e862bea Remove trailing newline from wwlog
I noticed that some wwlog calls included a trailing newline, but others
did not. I tested both in isolation and discovered that the behavior was
consistent regardless of whether a trailing newline was included. I
further confirmed in code that wwlog appends a trailing newline
automatically if it is not present; so a trailing newline is unnecessary
in individual calls.

This commit removes trailing newlines from all calls to make them
consistent. It also replaces two calls to wwlog.Printf. (see #534)

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-15 12:38:03 -06:00
Christian Goll
6cc58fcfff Merge pull request #534 from anderbubble/wwlog-printf-cleanup
Replace all instances of wwlog.Printf
2022-09-14 08:18:44 +02:00
Jonathon Anderson
22910958b5 Replace all instances of wwlog.Printf
wwlog provides named loggers for each level, which requires
less code and is clearer than wwlog.Printf. The code has
included a mix of both, but this commit consolidates existing
code on the per-level functions.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2022-09-11 08:00:23 -06:00
Christian Goll
ed21052462 readded configure hostfile command 2022-06-27 11:50:27 +02:00
王子丹
b1b6c4a4d2 can disable tftp services with warewulf.conf 2022-06-03 21:07:45 +08:00
Gregory Kurtzer
27ea7f2022 Update to new PXE which should support imgextract 2022-05-26 19:55:00 -07:00
Christian Goll
efb116919f enable host overlays, inform users if not enabled 2022-05-04 10:16:38 +02:00
Christian Goll
2d2fb13423 warewulf.conf option disable host overlays 2022-03-30 17:23:38 +02:00
Gregory Kurtzer
ce74d6f14a Fix lint error with unused function 2022-02-27 18:59:16 -08:00
Gregory Kurtzer
2927495de1 Fixes to #304 and #311 2022-02-27 18:54:51 -08:00
Christian Goll
eeb062cf85 moved dhcpd configuration to host templating 2022-02-26 22:39:50 +00:00
Christian Goll
afc94ebd42 created exports with template 2022-02-26 22:39:50 +00:00