wwclient uses WW_IPADDR, if set, to contact the Warewulf server.

- Closes: #1788

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-03-22 01:24:09 -06:00
parent be322a8062
commit e4a9018b80
6 changed files with 14 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- Added `wwctl overlay import --overwrite` to overwrite existing overlay file.
- wwclient uses `WW_IPADDR`, if set, to contact the Warewulf server. #1788
### Fixed

View File

@@ -193,8 +193,12 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
}
}()
var finishedInitialSync bool = false
ipaddr := os.Getenv("WW_IPADDR")
if ipaddr == "" {
ipaddr = conf.Ipaddr
}
for {
updateSystem(conf.Ipaddr, conf.Warewulf.Port, wwid, tag, localUUID)
updateSystem(ipaddr, conf.Warewulf.Port, wwid, tag, localUUID)
if !finishedInitialSync {
// ignore error and status here, as this wouldn't change anything
_, _ = daemon.SdNotify(false, daemon.SdNotifyReady)

View File

@@ -57,5 +57,6 @@ Filename: warewulf/init.d/80-wwclient
# Only start if the systemd is not available
test -e /usr/lib/systemd/systemd && exit 0
echo "Starting wwclient"
if [ -r /etc/default/wwclient ]; then . /etc/default/wwclient; fi
nohup /warewulf/wwclient >/var/log/wwclient.log 2>&1 </dev/null &
`

View File

@@ -5,6 +5,7 @@ After=local-fs.target
[Service]
Type=notify
EnvironmentFile=-/etc/default/wwclient
ExecStart=/warewulf/wwclient
ExecReload=/bin/kill -s SIGHUP "$MAINPID"
PIDFile=/var/run/wwclient.pid

View File

@@ -5,4 +5,5 @@
# Only start if the systemd is not available
test -e /usr/lib/systemd/systemd && exit 0
echo "Starting wwclient"
if [ -r /etc/default/wwclient ]; then . /etc/default/wwclient; fi
nohup {{ .Paths.WWClientdir }}/wwclient >/var/log/wwclient.log 2>&1 </dev/null &

View File

@@ -52,7 +52,7 @@ A node or profile can configure an overlay in two different ways:
.. code-block:: shell
wwctl profile set default \
--system-overlays="wwinit,,wwclient,fstab,hostname,ssh.host_keys,systemd.netname,NetworkManager" \
--system-overlays="wwinit,wwclient,fstab,hostname,ssh.host_keys,systemd.netname,NetworkManager" \
--runime-overlays="hosts,ssh.authorized_keys"
Multiple overlays can be applied to a single node, and overlays from multiple
@@ -202,6 +202,10 @@ All configured overlays are provisioned initially along with the node image
itself; but **wwclient** periodically fetches and applies the runtime overlay to
allow configuration of some settings without a reboot.
wwclient will contat the ``ipaddr`` value from ``warewulf.conf`` by default.
This can be overridden by specifying a ``WW_IPADDR`` environment variable, which
can be set via an overlay in ``/etc/default/wwclient``.
Network interfaces
------------------