This commit is contained in:
2026-02-15 07:18:14 +08:00
parent d7cd899983
commit 8a7bf8a39c
39 changed files with 1578 additions and 2868 deletions

29
tmpls/autofs.yaml Normal file
View File

@@ -0,0 +1,29 @@
description: AutoFS server for SunHPC clusters
copyright: |
Copyright (c) 2026 SunHPC Project.
Licensed under Apache 2.0.
stages:
post:
- type: file
path: /etc/auto.master
content: |
/share /etc/auto.share --timeout=1200
/home /etc/auto.home --timeout=1200
- type: file
path: /etc/auto.share
content: |
apps {{ .Node.Hostname }}.{{ .Cluster.Domain }}:/export/&
- type: script
content: |
mkdir -p /export/apps
echo "AutoFS 配置已生成"
configure:
- type: script
condition: "{{ if .Node.OldHostname }}true{{ end }}"
content: |
sed -i 's/{{ .Node.OldHostname }}/{{ .Node.Hostname }}/g' /etc/auto.share
systemctl restart autofs

9
tmpls/tmpls.go Normal file
View File

@@ -0,0 +1,9 @@
package tmpls
import (
"embed"
_ "embed"
)
//go:embed *.yaml
var FS embed.FS