feature-8 #9
1 changed files with 5 additions and 0 deletions
f-8: code: start/stop metadata service
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
commit
9892646814
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue