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"
|
configuration "git.g3e.fr/syonad/two/internal/config/agent"
|
||||||
"git.g3e.fr/syonad/two/internal/load_db/nocloud"
|
"git.g3e.fr/syonad/two/internal/load_db/nocloud"
|
||||||
"git.g3e.fr/syonad/two/pkg/db/kv"
|
"git.g3e.fr/syonad/two/pkg/db/kv"
|
||||||
|
"git.g3e.fr/syonad/two/pkg/systemd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
@ -22,6 +23,8 @@ func main() {
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
service, _ := systemd.New()
|
||||||
|
|
||||||
conf, err := configuration.LoadConfig(*conf_file)
|
conf, err := configuration.LoadConfig(*conf_file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
@ -43,7 +46,9 @@ func main() {
|
||||||
Password: *password,
|
Password: *password,
|
||||||
SSHKEY: *ssh_key,
|
SSHKEY: *ssh_key,
|
||||||
}, db)
|
}, db)
|
||||||
|
service.Start("metadata@" + *vm_name)
|
||||||
} else if *stop {
|
} else if *stop {
|
||||||
nocloud.UnLoadNoCloudInDB(*vm_name, db)
|
nocloud.UnLoadNoCloudInDB(*vm_name, db)
|
||||||
|
service.Stop("metadata@" + *vm_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue