feature-8 #9

Merged
nicolas.boufideline merged 27 commits from feature-8 into main 2026-01-04 16:51:23 +00:00
Showing only changes of commit 9892646814 - Show all commits

f-8: code: start/stop metadata service

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
GnomeZworc 2026-01-04 17:43:51 +01:00
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -7,6 +7,7 @@ import (
configuration "git.g3e.fr/syonad/two/internal/config/agent"
"git.g3e.fr/syonad/two/internal/load_db/nocloud"
"git.g3e.fr/syonad/two/pkg/db/kv"
"git.g3e.fr/syonad/two/pkg/systemd"
)
func main() {
@ -22,6 +23,8 @@ func main() {
flag.Parse()
service, _ := systemd.New()
conf, err := configuration.LoadConfig(*conf_file)
if err != nil {
fmt.Println(err)
@ -43,7 +46,9 @@ func main() {
Password: *password,
SSHKEY: *ssh_key,
}, db)
service.Start("metadata@" + *vm_name)
} else if *stop {
nocloud.UnLoadNoCloudInDB(*vm_name, db)
service.Stop("metadata@" + *vm_name)
}
}