diff --git a/internal/app/wwctl/configure/nfs/main.go b/internal/app/wwctl/configure/nfs/main.go index cfc58a33..b9d5ec08 100644 --- a/internal/app/wwctl/configure/nfs/main.go +++ b/internal/app/wwctl/configure/nfs/main.go @@ -63,6 +63,13 @@ func Configure(show bool) error { fmt.Fprintf(fstab, "%s:%s %s nfs defaults 0 0\n", controller.Ipaddr, export, export) } + for _, export := range controller.Nfs.ExportsExtended { + fmt.Fprintf(exports, "%s %s/%s(%s)\n", export.Path, controller.Network, controller.Netmask, export.Options) + if export.Mount { + fmt.Fprintf(fstab, "%s:%s %s nfs defaults 0 0\n", controller.Ipaddr, export.Path, export.Path) + } + } + fmt.Printf("Enabling and restarting the NFS services\n") if controller.Nfs.SystemdName == "" { err := util.SystemdStart("nfs-server") @@ -81,12 +88,17 @@ func Configure(show bool) error { for _, export := range controller.Nfs.Exports { fmt.Printf("%s %s/%s\n", export, controller.Network, controller.Netmask) } + for _, export := range controller.Nfs.ExportsExtended { + fmt.Printf("%s %s/%s\n", export.Path, controller.Network, controller.Netmask) + } fmt.Printf("\n") fmt.Printf("SYSTEM OVERLAY: default/etc/fstab:\n") for _, export := range controller.Nfs.Exports { fmt.Printf("%s:%s %s nfs defaults 0 0\n", controller.Ipaddr, export, export) } - + for _, export := range controller.Nfs.ExportsExtended { + fmt.Printf("%s:%s %s nfs defaults 0 0\n", controller.Ipaddr, export.Path, export.Path) + } } return nil diff --git a/internal/pkg/warewulfconf/datastructure.go b/internal/pkg/warewulfconf/datastructure.go index 8315ddd6..620665f8 100644 --- a/internal/pkg/warewulfconf/datastructure.go +++ b/internal/pkg/warewulfconf/datastructure.go @@ -45,9 +45,16 @@ type TftpConf struct { type NfsConf struct { Enabled bool `yaml:"enabled"` Exports []string `yaml:"exports"` + ExportsExtended []*NfsExportConf `yaml:"exports extended"` SystemdName string `yaml:"systemd name"` } +type NfsExportConf struct { + Path string `yaml:"path"` + Options string `yaml:"options"` + Mount bool `yaml:"mount"` +} + func init() { //TODO: Check to make sure nodes.conf is found if !util.IsFile(ConfigFile) {