Commit Graph

1173 Commits

Author SHA1 Message Date
Tobias Poschwatta
971d9e2118 Add option for wwclient port number
With this change, you can specify a port number for wwclient.
If

  wwclient:
    port: NUMBER

is specified in warewulf.conf, wwclient will bind to the specified local
port NUMBER. If no port is specified, wwclient will use any available
port, or port 987 if secure is true.

Port 987 is in the default port range used by the Linux NFS client
(665-1023, see linux/include/linux/sunrpc/xprtsock.h). Changing
the port can avoid failures when port 987 is already in use.

Signed-off-by: Tobias Poschwatta <poschwatta@zib.de>
2024-08-02 11:09:16 +02:00
xu yang
cec903aeeb resovle the comments
Signed-off-by: xu yang <xyang@ciq.com>
2024-07-25 06:42:16 +00:00
xu yang
62d9b5f71d fix the failure when updating overlay files existing on different partitions
Signed-off-by: xu yang <xyang@ciq.com>
2024-07-25 02:29:29 +00:00
Jonathon Anderson
9050622f68 Ensure autobuilt overlays include contextual overlay contents.
Following #1249, autobuilt overlays were being built with no contents.

This change follows the pattern in `wwctl overlay build` to include configured
overlays when none are explicitly specified.

Inspired by #1296.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-10 16:06:06 -04:00
David McFarlane
5bb73c90c5 Accept + within kernel versions 2024-07-05 15:29:50 -06:00
Christian Goll
2dfd28cb6c Add tests for kernel versions containing +
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-07-05 15:29:37 -06:00
Christian Goll
4a4fcc97d4 wwctl overlay list completes existing overlays
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-07-05 15:17:23 -06:00
Jonathon Anderson
0b765d242a Extend new syncuser handling for +/- entries
Since these lines are being omitted in the final sync'd passwd/group
file, a new message indicates that the line is being skipped; but it is
no longer denoted as a parse error.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-04 23:54:46 -06:00
Christian Goll
ba3c24e1c3 ignore +:: style lines in passwd/group
The lines +::::: or +::: are used in passwd/group as
placeholer for users added form the network via ldap/nis/sssd.
These lines should not trigger a warning.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-07-04 23:54:46 -06:00
Christian Goll
cfacb4d520 mount /sys and /run during container exec
Also unify mounting of sys, run, proc, and dev as occuring within the
chroot and without bind mounts from the host.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-04 07:54:55 +02:00
xu yang
371e4d63a6 Fix multiple issues in wwctl overlay edit
- Fixes #1236
- Fixes #1235

Signed-off-by: xu yang <xyang@ciq.com>
2024-07-03 17:57:25 -06:00
Jonathon Anderson
75d9ac5fb2 Capture "broken" symlinks during container build
- Fixes #1267

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-07-01 17:12:25 -06:00
Christian Goll
d233b4f71d Merge pull request #1270 from jeburks2/wwclient_dmidecode
Asset-tag fixes in dhcpd.conf.ww and wwclient
2024-06-24 16:42:29 +02:00
xu yang
170d03e751 fix the issue that system/runtime overlays are not auto-rebuilt
Signed-off-by: xu yang <xyang@ciq.com>
2024-06-19 09:31:32 +00:00
Josh Burks
790375822c wwclient: added dmidecode as a method to obtain asset-tag if smbios fails fix #1110"
Signed-off-by: Josh Burks <jeburks2@asu.edu>
2024-06-18 09:08:19 -07:00
Tobias Ribizel
faacb1cc4e Add test for FindFilterFiles
Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2024-06-17 00:01:14 +02:00
Tobias Ribizel
a6a0538f42 Fix FindFilterFiles
There are two bugs in the handling of exclusion patterns:
- The paths being checked against patterns are relative,
  so leading / need to be stripped
- filepath.Match only does a string comparison,
  and the paths we traverse don't include trailing /

Signed-off-by: Tobias Ribizel <mail@ribizel.de>
2024-06-17 00:01:04 +02:00
xu yang
c28404ea6c Add test cases for container exec
Signed-off-by: xu yang <xyang@ciq.com>
2024-06-11 23:59:36 -06:00
Jonathon Anderson
5bb13c8baf Fix regression in container exec argument parsing
- Fixes #1250

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-11 23:57:58 -06:00
Jonathon Anderson
2c5e079d33 Refactor overlayDir to container.RunDir()
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-07 14:18:19 -06:00
Christian Goll
0eba837950 use warewulf.conf from parent on child
The directories for the overlays needed for the bind
mount are now created under conf.Paths.WWChrootdir/$CONTAINERNAME
with the pattern $CONTAINERNAME-run-xxxxxx. This pattern can be
used as lock, so that there can't be congruent shell/exec calls
to the same container.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-06-06 16:46:10 -04:00
Christian Goll
dc6db3d565 using the right overlay directory and remove it
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-06-06 16:46:10 -04:00
Jonathon Anderson
05b951d78d Support dracut booting with GRUB
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-06 16:34:53 -04:00
xu yang
48d6b63030 Add tests for new iPXE template variables
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-06 03:20:12 -04:00
Jonathon Anderson
53dae60e20 New, optional dracut.ipxe configuration
dracut.ipxe boots an initramfs detected in the container image. This
required a few small changes to warewulfd and the wwinit overlay to
accommodate the dracut initramfs configuring the network interface
before wwinit:

- Include .NetDevs in the ipxe configuration template, so that dracut
  can configure interfaces with the correct names.

- Configure NetworkManager to not keep the initramfs configuration, in
  stead applying the configuration found by wwinit.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-06 03:20:09 -04:00
xu yang
a322061fe9 Add initramfs stage to warewulfd
The initramfs stage supports serving an initramfs image from within the
container image, typically generated by dracut.

Signed-off-by: xu yang <xyang@ciq.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-06 03:14:21 -04:00
Christian Goll
68ca92244d wwctl configure --all calls SSH(keys)
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-06-03 19:36:01 -06:00
Jonathon Anderson
6b8ca378d8 Refactor syncuser to reduce walking the container fs
- Closes #1209

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-06-03 19:18:25 -06:00
Xu Yang
b3d8f9ccc5 add CIDR format to warewulf.conf parse
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-05-31 23:36:35 -06:00
David McFarlane
41535cb8f9 Also prevent provisioning arbitrary overlays in secure mode
Signed-off-by: David McFarlane <54093156+Prepultrue@users.noreply.github.com>
2024-05-08 11:37:20 +10: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
21150d2975 make created ssh keys configureable
Signed-off-by: Christian Goll <cgoll@suse.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
Jonathon Anderson
03aae1a1d9 Fix parsing of /etc/group during syncuser
- Closes #1202

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-04-30 23:27:06 -06:00
Jonathon Anderson
addde549ff Only walk the filesystem during syncuser if writing
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-04-25 14:42:56 -06:00
Christian Goll
76a40f1364 Entry is aware if its ment as a slice or not
This is needed for printing out the values, as at this part in the
code there is no access to the NodeConf and only there the information
if the Entry is ment as a slice or not is available.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 22:28:05 -06:00
Christian Goll
fc80c4745c add various tests for wwctl node list -a
Altough getting and setting values is correct, `wwctl list -a`
will print superseded values as a list and mark them not as
superseded. Tests will fail after this commit.

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 22:24:54 -06:00
Christian Goll
2ba9efa57c created kernel.FindKernel reduces code complexity
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:12:22 -06:00
Christian Goll
b192e3b5d5 fixed ShimFind for aarch64
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:12:21 -06:00
Christian Goll
16f5b7408e added tests for BootLoaderFindPath for x86/aarch64
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-19 16:10:57 -06:00
Christian Goll
5c23a4cdde added {{ .Overlay }} to templates
{{ .Overlay }} contains the overlay name in which the template is
located, or an empty string if RenderTempalte is called outside the
warewulf overlay tree.

- Closes #1052

Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-17 21:40:32 -06:00
Christian Goll
71f5d42942 Add a read write mutex for node status
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-04-17 12:55:02 -06:00
Xu Yang
555947529f make necessary changes for code updates
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-04-04 00:17:30 -06:00
Xu Yang
2d1a39a3ee add support for rendering host tempalte
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-03-25 00:55:35 -06:00
Christian Goll
17a5aaefee added more aliases for wwctl commands
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-03-20 21:11:14 -06:00
Xu Yang
5956f2e9a1 use marshalindent instead of marshal
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-03-19 03:04:20 -06:00
Xu Yang
16183e603c add multiple formats support
Signed-off-by: Xu Yang <xyang@ciq.com>
2024-03-19 01:48:08 -06:00
Christian Goll
27c0297e5f fixed formating
Signed-off-by: Christian Goll <cgoll@suse.com>
2024-03-12 19:29:01 +01:00
Timothy Middelkoop
44c8a24ba8 Merge branch 'main' into tm-wwid-raspberry-pi 2024-03-12 12:51:54 -05:00
Yong Qin
0aca225ef7 Fixed a bug with profile list when kernelargs are set with 'var=val'
format. This also removed the unnecessary '--' for the source profile
since it's never used.
2024-03-11 11:04:21 +01:00