Merge pull request #98 from gmkurtzer/cleanups
Merging code and UI cleanups
This commit is contained in:
4
Makefile
4
Makefile
@@ -74,12 +74,10 @@ files: all
|
||||
install -c -m 0644 include/firewalld/warewulf.xml $(DESTDIR)/usr/lib/firewalld/services
|
||||
mkdir -p $(DESTDIR)/usr/lib/systemd/system
|
||||
install -c -m 0644 include/systemd/warewulfd.service $(DESTDIR)/usr/lib/systemd/system
|
||||
systemctl daemon-reload
|
||||
./bash_completion $(DESTDIR)/etc/bash_completion.d/warewulf
|
||||
./man_page $(DESTDIR)/usr/share/man/man1
|
||||
gzip --force $(DESTDIR)/usr/share/man/man1/wwctl*1
|
||||
|
||||
|
||||
# systemctl daemon-reload
|
||||
# cp -r tftpboot/* /var/lib/tftpboot/warewulf/ipxe/
|
||||
# restorecon -r /var/lib/tftpboot/warewulf
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"fmt"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
|
||||
if err := wwctl.GenManTree(os.Args[1]); err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
|
||||
@@ -9,4 +9,3 @@ func main() {
|
||||
|
||||
root.Execute()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package child
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package exec
|
||||
|
||||
@@ -26,7 +26,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
nodemap[n.KernelVersion.Get()]++
|
||||
}
|
||||
|
||||
fmt.Printf("%-35s %-6s\n", "VNFS NAME", "NODE#")
|
||||
fmt.Printf("%-35s %-6s\n", "VNFS NAME", "NODES")
|
||||
for _, k := range kernels {
|
||||
fmt.Printf("%-35s %6d\n", k, nodemap[k])
|
||||
}
|
||||
|
||||
@@ -24,15 +24,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
fmt.Printf("Added node: %s\n", a)
|
||||
|
||||
if SetClusterName != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting cluster name to: %s\n", n.Id.Get(), SetClusterName)
|
||||
n.ClusterName.Set(SetClusterName)
|
||||
if SetClusterName != "" {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Node: %s, Setting cluster name to: %s\n", n.Id.Get(), SetClusterName)
|
||||
n.ClusterName.Set(SetClusterName)
|
||||
err := nodeDB.NodeUpdate(n)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
wwlog.Printf(wwlog.ERROR, "%s\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
if SetIpaddr != "" {
|
||||
if SetNetDev == "" {
|
||||
|
||||
@@ -11,8 +11,8 @@ var (
|
||||
RunE: CobraRunE,
|
||||
Aliases: []string{"rm", "del"},
|
||||
}
|
||||
SetYes bool
|
||||
SetForce string
|
||||
SetYes bool
|
||||
SetForce string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/node/console"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/node/delete"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/node/list"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/node/ready"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/node/sensors"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/node/set"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -25,6 +26,7 @@ func init() {
|
||||
baseCmd.AddCommand(add.GetCommand())
|
||||
baseCmd.AddCommand(delete.GetCommand())
|
||||
baseCmd.AddCommand(console.GetCommand())
|
||||
baseCmd.AddCommand(ready.GetCommand())
|
||||
}
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
|
||||
@@ -58,7 +58,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
User: node.IpmiUserName.Get(),
|
||||
Password: node.IpmiPassword.Get(),
|
||||
Interface: ipmiInterface,
|
||||
AuthType: "MD5",
|
||||
AuthType: "MD5",
|
||||
}
|
||||
|
||||
fullFlag := full
|
||||
|
||||
@@ -6,9 +6,10 @@ var (
|
||||
baseCmd = &cobra.Command{
|
||||
Use: "set [flags] [node pattern]...",
|
||||
Short: "Configure node properties",
|
||||
Long: "This command will allow you to set configuration properties for nodes.",
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
RunE: CobraRunE,
|
||||
Long: "This command will allow you to set configuration properties for nodes.\n\n" +
|
||||
"Note: use the string 'UNSET' to remove a configuration",
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
RunE: CobraRunE,
|
||||
}
|
||||
SetComment string
|
||||
SetContainer string
|
||||
@@ -31,7 +32,7 @@ var (
|
||||
SetIpmiGateway string
|
||||
SetIpmiUsername string
|
||||
SetIpmiPassword string
|
||||
SetIpmiInterface string
|
||||
SetIpmiInterface string
|
||||
SetNodeAll bool
|
||||
SetYes bool
|
||||
SetProfile string
|
||||
|
||||
@@ -117,7 +117,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
var unconfigured bool
|
||||
for overlay, _ := range set {
|
||||
for overlay := range set {
|
||||
var overlayPath string
|
||||
|
||||
if SystemOverlay == true {
|
||||
|
||||
@@ -58,7 +58,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
User: node.IpmiUserName.Get(),
|
||||
Password: node.IpmiPassword.Get(),
|
||||
Interface: ipmiInterface,
|
||||
AuthType: "MD5",
|
||||
AuthType: "MD5",
|
||||
}
|
||||
|
||||
batchpool.Submit(func() {
|
||||
|
||||
@@ -58,7 +58,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
User: node.IpmiUserName.Get(),
|
||||
Password: node.IpmiPassword.Get(),
|
||||
Interface: ipmiInterface,
|
||||
AuthType: "MD5",
|
||||
AuthType: "MD5",
|
||||
}
|
||||
|
||||
batchpool.Submit(func() {
|
||||
|
||||
@@ -58,7 +58,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
User: node.IpmiUserName.Get(),
|
||||
Password: node.IpmiPassword.Get(),
|
||||
Interface: ipmiInterface,
|
||||
AuthType: "MD5",
|
||||
AuthType: "MD5",
|
||||
}
|
||||
|
||||
batchpool.Submit(func() {
|
||||
|
||||
@@ -6,9 +6,10 @@ var (
|
||||
baseCmd = &cobra.Command{
|
||||
Use: "set [flags] <profile pattern>...",
|
||||
Short: "Configure node profile properties",
|
||||
Long: "This command will allow you to set configuration properties for node profiles.",
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
RunE: CobraRunE,
|
||||
Long: "This command will allow you to set configuration properties for node profiles.\n\n" +
|
||||
"Note: use the string 'UNSET' to remove a configuration",
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
RunE: CobraRunE,
|
||||
}
|
||||
SetAll bool
|
||||
SetYes bool
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package wwctl
|
||||
|
||||
import (
|
||||
"io"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/configure"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/container"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/kernel"
|
||||
@@ -9,11 +8,12 @@ import (
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/overlay"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/power"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/profile"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/ready"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/server"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/cobra/doc"
|
||||
|
||||
"io"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -31,17 +31,13 @@ func init() {
|
||||
rootCmd.PersistentFlags().BoolVarP(&verboseArg, "verbose", "v", false, "Run with increased verbosity.")
|
||||
rootCmd.PersistentFlags().BoolVarP(&debugArg, "debug", "d", false, "Run with debugging messages enabled.")
|
||||
|
||||
//rootCmd.AddCommand(build.GetCommand())
|
||||
|
||||
rootCmd.AddCommand(overlay.GetCommand())
|
||||
// rootCmd.AddCommand(controller.GetCommand())
|
||||
rootCmd.AddCommand(container.GetCommand())
|
||||
rootCmd.AddCommand(node.GetCommand())
|
||||
rootCmd.AddCommand(kernel.GetCommand())
|
||||
rootCmd.AddCommand(power.GetCommand())
|
||||
rootCmd.AddCommand(profile.GetCommand())
|
||||
rootCmd.AddCommand(configure.GetCommand())
|
||||
rootCmd.AddCommand(ready.GetCommand())
|
||||
rootCmd.AddCommand(server.GetCommand())
|
||||
|
||||
}
|
||||
@@ -64,13 +60,13 @@ func rootPersistentPreRunE(cmd *cobra.Command, args []string) error {
|
||||
|
||||
// GenBashCompletionFile
|
||||
func GenBashCompletion(w io.Writer) error {
|
||||
return rootCmd.GenBashCompletion(w)
|
||||
return rootCmd.GenBashCompletion(w)
|
||||
}
|
||||
|
||||
func GenManTree(fileName string) error{
|
||||
func GenManTree(fileName string) error {
|
||||
header := &doc.GenManHeader{
|
||||
Title: "MINE",
|
||||
Title: "MINE",
|
||||
Section: "1",
|
||||
}
|
||||
return doc.GenManTree(rootCmd,header,fileName)
|
||||
return doc.GenManTree(rootCmd, header, fileName)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type NodeConf struct {
|
||||
IpmiIpaddr string `yaml:"ipmi ipaddr,omitempty"`
|
||||
IpmiNetmask string `yaml:"ipmi netmask,omitempty"`
|
||||
IpmiGateway string `yaml:"ipmi gateway,omitempty"`
|
||||
IpmiInterface string `yaml:"ipmi interface,omitempty"`
|
||||
IpmiInterface string `yaml:"ipmi interface,omitempty"`
|
||||
RuntimeOverlay string `yaml:"runtime overlay,omitempty"`
|
||||
SystemOverlay string `yaml:"system overlay,omitempty"`
|
||||
Init string `yaml:"init,omitempty"`
|
||||
@@ -107,8 +107,8 @@ func init() {
|
||||
c, err := os.OpenFile(ConfigFile, os.O_RDWR|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not create new configuration file: %s\n", err)
|
||||
// just return silently, as init is also called for bash_completion
|
||||
return
|
||||
// just return silently, as init is also called for bash_completion
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Fprintf(c, "nodeprofiles:\n")
|
||||
|
||||
@@ -38,7 +38,7 @@ func (ent *Entry) Set(val string) {
|
||||
return
|
||||
}
|
||||
|
||||
if val == "UNDEF" || val == "DELETE" || val == "UNSET" {
|
||||
if val == "UNDEF" || val == "DELETE" || val == "UNSET" || val == "--" {
|
||||
ent.value = ""
|
||||
} else {
|
||||
ent.value = val
|
||||
|
||||
@@ -159,7 +159,7 @@ func (config *nodeYaml) ProfileUpdate(profile NodeInfo) error {
|
||||
|
||||
config.NodeProfiles[profileID].Profiles = profile.Profiles
|
||||
config.NodeProfiles[profileID].NetDevs = make(map[string]*NetDevs)
|
||||
|
||||
|
||||
config.NodeProfiles[profileID].Keys = make(map[string]string)
|
||||
|
||||
for devname, netdev := range profile.NetDevs {
|
||||
|
||||
@@ -16,8 +16,8 @@ type IPMI struct {
|
||||
User string
|
||||
Password string
|
||||
AuthType string
|
||||
Interface string
|
||||
result IPMIResult
|
||||
Interface string
|
||||
result IPMIResult
|
||||
}
|
||||
|
||||
func (ipmi *IPMI) Result() (string, error) {
|
||||
@@ -28,9 +28,9 @@ func (ipmi *IPMI) Command(ipmiArgs []string) ([]byte, error) {
|
||||
|
||||
var args []string
|
||||
|
||||
if ipmi.Interface == "" {
|
||||
ipmi.Interface = "lanplus"
|
||||
}
|
||||
if ipmi.Interface == "" {
|
||||
ipmi.Interface = "lanplus"
|
||||
}
|
||||
args = append(args, "-I", ipmi.Interface, "-H", ipmi.HostName, "-U", ipmi.User, "-P", ipmi.Password)
|
||||
args = append(args, ipmiArgs...)
|
||||
ipmiCmd := exec.Command("ipmitool", args...)
|
||||
@@ -41,9 +41,9 @@ func (ipmi *IPMI) InteractiveCommand(ipmiArgs []string) error {
|
||||
|
||||
var args []string
|
||||
|
||||
if ipmi.Interface == "" {
|
||||
ipmi.Interface = "lan"
|
||||
}
|
||||
if ipmi.Interface == "" {
|
||||
ipmi.Interface = "lan"
|
||||
}
|
||||
|
||||
args = append(args, "-I", ipmi.Interface, "-H", ipmi.HostName, "-U", ipmi.User, "-P", ipmi.Password)
|
||||
args = append(args, ipmiArgs...)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package warewulfconf
|
||||
|
||||
import (
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/util"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
)
|
||||
@@ -51,7 +50,7 @@ func init() {
|
||||
//TODO: Check to make sure nodes.conf is found
|
||||
if util.IsFile(ConfigFile) == false {
|
||||
wwlog.Printf(wwlog.ERROR, "Configuration file not found: %s\n", ConfigFile)
|
||||
// fail silently as this also called by bash_completion
|
||||
return
|
||||
// fail silently as this also called by bash_completion
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
0
overlays/system/default/etc/network/interfaces.d/eth0.ww
Executable file → Normal file
0
overlays/system/default/etc/network/interfaces.d/eth0.ww
Executable file → Normal file
0
overlays/system/default/etc/systemd/network/10-persistent-net.link.ww
Executable file → Normal file
0
overlays/system/default/etc/systemd/network/10-persistent-net.link.ww
Executable file → Normal file
@@ -9,6 +9,9 @@ Group: System Environment/Clustering
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
ExclusiveOS: linux
|
||||
BuildRoot: %{?_tmppath}/%{name}-%{version}-%{release}-root
|
||||
Requires: dhcp-server
|
||||
Requires: tftp-server
|
||||
Requires: nfs-utils
|
||||
|
||||
%description
|
||||
Warewulf is a bare metal container provisioning system.
|
||||
@@ -39,10 +42,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-, root, root)
|
||||
%attr(0755, root, warewulf) %dir /etc/warewulf/
|
||||
%config(noreplace) /etc/warewulf/*
|
||||
/etc/bash_completion.d/warewulf
|
||||
/usr/bin/wwctl
|
||||
/usr/lib/firewalld/services/warewulf.xml
|
||||
/usr/lib/systemd/system/warewulfd.service
|
||||
/var/warewulf
|
||||
/usr/share/man/man1/*
|
||||
|
||||
%changelog
|
||||
* Tue Jan 26 2021 14:46:24 JST Brian Clemens <bclemens@ctrliq.com> - 4.0.0
|
||||
|
||||
Reference in New Issue
Block a user