Commit Graph

84 Commits

Author SHA1 Message Date
Christian Goll
f2bc70ad00 Add structures for devices and filesystems
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-08-21 16:19:13 -06:00
Jonathon Anderson
2319906d97 Fix writing of nodes.conf
The caching functionality of nodes.conf, and the optional persistence
functionality that came with it, appears to have been preventing
actually writing the configuration to disk in all cases. This change
fixes the ability to write to nodes.conf.

Somewhat opinionatedly, this change removes the caching functionality of
nodes.conf. The tests have also been updated to use real files for i/o
rather than tying into the caching system, making them more accurately
test the ability of Warewulf to actually read and write its
configuration.

Fixes #779

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-14 10:53:31 -06:00
Christian Goll
b0602133ec use netParseIP and ParseMAC
check also MAC addresses and common formating

Signed-off-by: Christian Goll <cgoll@suse.de>

reformat ipaddr for test coverage

fixed processing of default values

updated transformer tests

correct behavior for tags

add tests for tags

new tests for primary network

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:07 +01:00
Christian Goll
13bc378a6b Refactor the CreateFlags command
* added the additional type flag, which can be bool,IP
* UNDEF is recognized for the bool flag
* 0.0.0.0 must be used as UNDEF for IP flag

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:15:50 +01:00
Christian Goll
c1e2100322 added a test for wwctl node add
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:10:29 +01:00
Christian Goll
c6b65bc853 set the primary network in NodeInfo not in NetDev
Prior the primary was a boolean attribute of NetDev, so several
NetDevs could have been primay. Setting is as a sting in NodeConf
assures that only one network could be primary.
If no primary network is set, a valid altvalue will be set.
2023-02-10 10:46:01 +01:00
Christian Goll
4fe584547b Merge branch 'development' into wwlog-newlines 2022-10-13 14:46:03 +02:00
Christian Goll
33504354c2 Merge branch 'development' into node-edit 2022-10-13 09:59:38 +02:00
Christian Goll
6ff4839b0f Merge pull request #549 from mslacken/add-mtu
added mtu
2022-10-12 21:30:07 +02:00
Christian Goll
9e41de9fdf adde mtu 2022-09-30 16:26:14 +02:00
Christian Goll
7087f3e4a1 add edit command for direct edit of node entries 2022-09-16 16:51:07 +02: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
efd761f7c3 Read the defaults for anode from defaults.conf 2022-09-15 11:14:26 +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
255ff61dc8 adding netname option back 2022-08-31 17:05:28 +02:00
Christian Goll
063c781710 recreate CreateFlag based on NodeConf
This will always create the network named default,
so this has to be changed if a new netowk is set
2022-08-19 16:33:46 +02:00
Christian Goll
41d12888ab reflections for unmarshal 2022-08-10 14:16:48 +02:00
Christian Goll
ed5b2bbf35 using tag instead of key 2022-08-03 13:44:12 +02:00
Christian Goll
b548d8583d reflection on constructor 2022-08-03 11:28:15 +02:00
Christian Goll
e23f794166 simplified node list command 2022-07-19 17:21:27 +02:00
Christian Goll
c8d70e23ad rebased on new API 2022-07-11 16:34:08 +02:00
Christian Goll
29573e26ad added more values 2022-07-07 11:39:02 +02:00
Christian Goll
8902f08c87 added hangling of map[string]*struct 2022-07-07 11:37:18 +02:00
Christian Goll
84d3b72f63 added more abstrac setter for nested structs 2022-07-07 11:29:58 +02:00
Christian Goll
bd2543d484 relection test for comment 2022-07-07 11:28:27 +02:00
MatthewHink
d8cd6049ac Initial cut of wwapi.
We need an API for Warewulf in order to automate around it. The initial version of the API will look a lot like wwctl. wwctl will call the API so that we do not need to maintain separate code paths. In this preview wwctl calls the API via direct function call, but we can change that to a gprc or REST call to a Warewulf server in the future.

This commit contains:
wwapid WareWulf API Daemon. A grpc server with mTLS auth.
wwapic WareWulf API Client. A grpc client with mTLS auth. It's just a sample that reads the version from the server.
wwapird WareWulf API Rest Daemon. A http REST reverse proxy to wwapid.
There are also sample insecure and secure curls to test with.

Implemented Functionality:
wwctl node add
wwctl node delete
wwctl node list
wwctl node set
wwctl node status
wwctl container build
wwctl container delete
wwctl container import
wwctl container list
wwctl container show

Some notes on the files:

    Logic that was in wwctl has moved to warewulf/internal/pkg/api. wwctl just calls the API. wwctl functionality is unchanged.
    Everything under the /google directory is copied google proto code to stand up wwapird. It's a bit strange to copy in the code, but that is currently how it's done.
    Everything in warewulf/internal/pkg/api/routes/wwapiv1 is generated code.

There are some loose ends here, such as no service installers. I just ran off the command line for development.
The Makefile could use improvement. I'm building by make clean setup proto all build wwapid wwapic wwapird ; echo $?
I copied the configs from warewulf/etc to /usr/local/etc/warewulf manually.
2022-06-24 08:39:30 -07:00
Christian Goll
80c92475b0 added backwards compatibilty for default 2022-05-12 11:51:00 +02:00
jcsiadal
9b6b93a5cb Rename default to primary in src
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-05-05 03:13:21 +00:00
jcsiadal
dbd747788f wwctl profile fixes
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-04-19 21:59:34 +00:00
Christian Goll
e29aea8ae3 using stirng for ipmiwrite storage 2022-04-14 12:50:38 +02:00
mslacken
f68c0a3633 add backward compatiblity for old yaml syntax 2022-04-14 09:33:30 +02:00
Christian Goll
95050a44ce add user defined keys for networks/netdev
Every network in the profile and for the nodes can have induvidual keys values
pairs, called Tags, which are propergated to the templates. So they can be used
for things like MTU size like
  `wwct node set node01 --nettag mtu=9000`
and in in ifcfg.xml.ww
```
{{ if $netdev.Tags.mtu -}}
<mtu> {{ $netdev.Tags.mtu }} </mtu>
{{ end -}}
```
2022-04-06 21:36:17 +02:00
jcsiadal
bd3edb9e7f Udated constructors/mods
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-04-04 16:13:09 +00:00
jcsiadal
1fda01fc36 Datastructure update
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2022-04-04 16:13:09 +00:00
Christian Goll
c0f7ecf357 store the ovelats as yaml list 2022-03-24 19:45:51 +01:00
Christian Goll
55bf1695de initial commit of simple ipv6 support
As soon as in warewulf.conf a value for ipaddr6 is defined
all nodes will get a derived ipv6 address if not the ipv6
is not explicitly set.
2022-03-15 15:57:35 +01:00
Christian Goll
5ac75661c9 Only write to IPMI if this is explictly wanted 2022-03-02 21:24:05 +01:00
Gregory Kurtzer
1203186194 Support kernel overrides from the host or other containers 2022-02-17 07:37:04 +00:00
Gregory Kurtzer
104bc7527d Restored deleted kernel components for overrides 2022-02-17 06:21:40 +00:00
Gregory Kurtzer
5a0c13225e Utilize containerized kernel and remove kernel Support 2022-02-15 06:49:24 +00:00
Gregory Kurtzer
e6a3810d20 Fixing oddball network configuration parameters 2022-02-12 03:08:33 +00:00
Gregory Kurtzer
49150c172e Reverse compatibility for keys to tags 2022-02-11 15:36:38 +00:00
Gregory Kurtzer
ffaf794a42 Changed "key" paramaters to tags and cleaned up interface 2022-02-11 05:52:46 +00:00
Gregory Kurtzer
b165928699 Change how boolean node members behave (transform two and from strings) 2022-02-10 16:36:14 +00:00
Gregory Kurtzer
d9c13c3f36 Initial commit of asset key tag security check 2022-01-24 00:32:02 +00:00
Gregory Kurtzer
9f53bca1bf Various fixes found in testing 2021-12-29 17:16:53 -08:00
Gregory Kurtzer
938511e9cd Merge branch 'main' of github.com:gmkurtzer/warewulf into netdev_refactor 2021-12-28 15:17:21 -08:00
jcsiadal
f7396ae5be Updates to build an RPM
Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
2021-11-01 11:32:59 -07:00
Gregory Kurtzer
1370932cd3 Introduction of netname functionality for network devices 2021-10-23 07:12:57 -07:00
Christian Goll
83232db4b5 nodes.conf must not be world readable as it contains impipassword 2021-10-13 09:32:19 +02:00