7
Makefile
7
Makefile
@@ -64,11 +64,6 @@ files: all
|
||||
# cp -r tftpboot/* /var/lib/tftpboot/warewulf/ipxe/
|
||||
# restorecon -r /var/lib/tftpboot/warewulf
|
||||
|
||||
services: files
|
||||
groupadd -r warewulf
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now warewulfd
|
||||
|
||||
wwctl:
|
||||
cd cmd/wwctl; go build -mod vendor -tags "$(WW_BUILD_GO_BUILD_TAGS)" -o ../../wwctl
|
||||
|
||||
@@ -89,4 +84,4 @@ clean:
|
||||
rm -rf _dist
|
||||
rm -f warewulf-$(VERSION).tar.gz
|
||||
|
||||
install: files services
|
||||
install: files
|
||||
|
||||
@@ -109,12 +109,14 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
err = container.ImportDocker(uri, name, sCtx)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not import image: %s\n", err)
|
||||
_ = container.DeleteSource(name)
|
||||
os.Exit(1)
|
||||
}
|
||||
} else if util.IsDir(uri) {
|
||||
err := container.ImportDirectory(uri, name)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not import image: %s\n", err)
|
||||
_ = container.DeleteSource(name)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func init() {
|
||||
baseCmd.PersistentFlags().StringVar(&SetComment, "comment", "", "Set a comment for this node")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetContainer, "container", "C", "", "Set the container (VNFS) for this node")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetKernel, "kernel", "K", "", "Set Kernel version for nodes")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetKernel, "kernelargs", "A", "", "Set Kernel argument for nodes")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetKernelArgs, "kernelargs", "A", "", "Set Kernel argument for nodes")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetClusterName, "cluster", "c", "", "Set the node's cluster group")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetIpxe, "ipxe", "P", "", "Set the node's iPXE template name")
|
||||
baseCmd.PersistentFlags().StringVarP(&SetInit, "init", "i", "", "Define the init process to boot the container")
|
||||
|
||||
@@ -50,10 +50,10 @@ func GetRootCommand() *cobra.Command {
|
||||
}
|
||||
|
||||
func rootPersistentPreRunE(cmd *cobra.Command, args []string) error {
|
||||
if verboseArg == true {
|
||||
wwlog.SetLevel(wwlog.VERBOSE)
|
||||
} else if debugArg == true {
|
||||
if debugArg == true {
|
||||
wwlog.SetLevel(wwlog.DEBUG)
|
||||
} else if verboseArg == true {
|
||||
wwlog.SetLevel(wwlog.VERBOSE)
|
||||
} else {
|
||||
wwlog.SetLevel(wwlog.INFO)
|
||||
}
|
||||
|
||||
@@ -88,5 +88,6 @@ func ValidSource(name string) bool {
|
||||
func DeleteSource(name string) error {
|
||||
fullPath := SourceDir(name)
|
||||
|
||||
wwlog.Printf(wwlog.VERBOSE, "Removing path: %s\n", fullPath)
|
||||
return os.RemoveAll(fullPath)
|
||||
}
|
||||
@@ -28,8 +28,8 @@ groupadd -r warewulf >/dev/null 2>&1 || :
|
||||
|
||||
%post
|
||||
%if %{?rhel}%{!?rhel:0} >= 7
|
||||
systemctl start warewulfd >/dev/null 2>&1 || :
|
||||
systemctl enable warewulfd >/dev/null 2>&1 || :
|
||||
groupadd -r warewulf >/dev/null 2>&1 || :
|
||||
systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
%endif
|
||||
|
||||
%clean
|
||||
|
||||
Reference in New Issue
Block a user