make created ssh keys configureable
Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
ad6699c110
commit
21150d2975
@@ -28,7 +28,7 @@ func init() {
|
||||
baseCmd.AddCommand(nfs.GetCommand())
|
||||
baseCmd.AddCommand(hostfile.GetCommand())
|
||||
|
||||
baseCmd.PersistentFlags().BoolVarP(&allFunctions, "all", "a", false, "Configure all services")
|
||||
baseCmd.Flags().BoolVarP(&allFunctions, "all", "a", false, "Configure all services")
|
||||
}
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
|
||||
@@ -2,9 +2,13 @@ package ssh
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
|
||||
"github.com/warewulf/warewulf/internal/pkg/configure"
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
if len(keyTypes) == 0 {
|
||||
keyTypes = append(keyTypes, warewulfconf.Get().SSH.KeyTypes...)
|
||||
}
|
||||
return configure.SSH(keyTypes...)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package ssh
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
baseCmd = &cobra.Command{
|
||||
@@ -20,6 +22,6 @@ func init() {
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
func GetCommand() *cobra.Command {
|
||||
baseCmd.PersistentFlags().StringArrayVarP(&keyTypes, "keytypes", "t", []string{"rsa", "dsa", "ecdsa", "ed25519"}, "ssh key types to be created")
|
||||
baseCmd.PersistentFlags().StringArrayVarP(&keyTypes, "keytypes", "t", []string{}, "ssh key types to be created")
|
||||
return baseCmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user