///
This commit is contained in:
2
examples/virt/hetzner/.gitignore
vendored
2
examples/virt/hetzner/.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
hetzner_kristof1
|
||||
hetzner_kristof2
|
||||
hetzner_kristof3
|
||||
hetzner_test1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env hero
|
||||
#!/usr/bin/env hero
|
||||
|
||||
|
||||
// !!hetznermanager.configure
|
||||
@@ -33,5 +33,3 @@
|
||||
server_name: 'kristof2'
|
||||
wait: true
|
||||
hero_install: true // Install Herolib on the new OS
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ passwd := os.environ()['HETZNER_PASSWORD'] or {
|
||||
hs := '
|
||||
!!hetznermanager.configure
|
||||
user:"${user}"
|
||||
whitelist:"2521602,2555487"
|
||||
whitelist:"2521602,2555487,2573047"
|
||||
password:"${passwd}"
|
||||
sshkey:"kristof"
|
||||
'
|
||||
@@ -42,28 +42,28 @@ mut cl := hetznermanager.get()!
|
||||
|
||||
println(cl.servers_list()!)
|
||||
|
||||
mut serverinfo := cl.server_info_get(name: 'kristof1')!
|
||||
mut serverinfo := cl.server_info_get(name: name)!
|
||||
|
||||
println(serverinfo)
|
||||
|
||||
// cl.server_reset(name: 'kristof2', wait: true)!
|
||||
|
||||
// cl.server_rescue(name: 'kristof1', wait: true, hero_install: true)!
|
||||
// cl.server_rescue(name: name, wait: true, hero_install: true)!
|
||||
|
||||
// mut ks := cl.keys_get()!
|
||||
// println(ks)
|
||||
|
||||
// console.print_header('SSH login')
|
||||
// mut b := builder.new()!
|
||||
// mut n := b.node_new(ipaddr: serverinfo.server_ip)!
|
||||
|
||||
// this will put hero in debug mode on the system
|
||||
// n.hero_install(compile: true)!
|
||||
|
||||
// n.shell('')!
|
||||
|
||||
cl.ubuntu_install(name: name, wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(name: 'kristof20', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id:2550378, name: 'kristof21', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id:2550508, name: 'kristof22', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id: 2550253, name: 'kristof23', wait: true, hero_install: true)!
|
||||
|
||||
// this will put hero in debug mode on the system
|
||||
mut b := builder.new()!
|
||||
mut n := b.node_new(ipaddr: serverinfo.server_ip)!
|
||||
n.hero_install(compile: true)!
|
||||
|
||||
n.shell('')!
|
||||
|
||||
69
examples/virt/hetzner/hetzner_kristof3.vsh
Executable file
69
examples/virt/hetzner/hetzner_kristof3.vsh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import incubaid.herolib.virt.hetznermanager
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.core.base
|
||||
import incubaid.herolib.builder
|
||||
import time
|
||||
import os
|
||||
import incubaid.herolib.core.playcmds
|
||||
|
||||
name := 'kristof3'
|
||||
|
||||
user := os.environ()['HETZNER_USER'] or {
|
||||
println('HETZNER_USER not set')
|
||||
exit(1)
|
||||
}
|
||||
passwd := os.environ()['HETZNER_PASSWORD'] or {
|
||||
println('HETZNER_PASSWORD not set')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
hs := '
|
||||
!!hetznermanager.configure
|
||||
user:"${user}"
|
||||
whitelist:"2521602,2555487,2573047"
|
||||
password:"${passwd}"
|
||||
sshkey:"kristof"
|
||||
'
|
||||
|
||||
println(hs)
|
||||
|
||||
playcmds.run(heroscript: hs)!
|
||||
|
||||
console.print_header('Hetzner Test.')
|
||||
|
||||
mut cl := hetznermanager.get()!
|
||||
// println(cl)
|
||||
|
||||
// for i in 0 .. 5 {
|
||||
// println('test cache, first time slow then fast')
|
||||
// }
|
||||
|
||||
println(cl.servers_list()!)
|
||||
|
||||
mut serverinfo := cl.server_info_get(name: name)!
|
||||
|
||||
println(serverinfo)
|
||||
|
||||
// cl.server_reset(name: 'kristof2', wait: true)!
|
||||
|
||||
// cl.server_rescue(name: name, wait: true, hero_install: true)!
|
||||
|
||||
// mut ks := cl.keys_get()!
|
||||
// println(ks)
|
||||
|
||||
// console.print_header('SSH login')
|
||||
|
||||
cl.ubuntu_install(name: name, wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(name: 'kristof20', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id:2550378, name: 'kristof21', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id:2550508, name: 'kristof22', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id: 2550253, name: 'kristof23', wait: true, hero_install: true)!
|
||||
|
||||
// this will put hero in debug mode on the system
|
||||
mut b := builder.new()!
|
||||
mut n := b.node_new(ipaddr: serverinfo.server_ip)!
|
||||
n.hero_install(compile: true)!
|
||||
|
||||
n.shell('')!
|
||||
69
examples/virt/hetzner/hetzner_test1.vsh
Executable file
69
examples/virt/hetzner/hetzner_test1.vsh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import incubaid.herolib.virt.hetznermanager
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.core.base
|
||||
import incubaid.herolib.builder
|
||||
import time
|
||||
import os
|
||||
import incubaid.herolib.core.playcmds
|
||||
|
||||
name := 'test1'
|
||||
|
||||
user := os.environ()['HETZNER_USER'] or {
|
||||
println('HETZNER_USER not set')
|
||||
exit(1)
|
||||
}
|
||||
passwd := os.environ()['HETZNER_PASSWORD'] or {
|
||||
println('HETZNER_PASSWORD not set')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
hs := '
|
||||
!!hetznermanager.configure
|
||||
user:"${user}"
|
||||
whitelist:"2575034"
|
||||
password:"${passwd}"
|
||||
sshkey:"kristof"
|
||||
'
|
||||
|
||||
println(hs)
|
||||
|
||||
playcmds.run(heroscript: hs)!
|
||||
|
||||
console.print_header('Hetzner Test.')
|
||||
|
||||
mut cl := hetznermanager.get()!
|
||||
// println(cl)
|
||||
|
||||
// for i in 0 .. 5 {
|
||||
// println('test cache, first time slow then fast')
|
||||
// }
|
||||
|
||||
println(cl.servers_list()!)
|
||||
|
||||
mut serverinfo := cl.server_info_get(name: name)!
|
||||
|
||||
println(serverinfo)
|
||||
|
||||
// cl.server_reset(name: 'kristof2', wait: true)!
|
||||
|
||||
// cl.server_rescue(name: name, wait: true, hero_install: true)!
|
||||
|
||||
// mut ks := cl.keys_get()!
|
||||
// println(ks)
|
||||
|
||||
// console.print_header('SSH login')
|
||||
|
||||
cl.ubuntu_install(name: name, wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(name: 'kristof20', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id:2550378, name: 'kristof21', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id:2550508, name: 'kristof22', wait: true, hero_install: true)!
|
||||
// cl.ubuntu_install(id: 2550253, name: 'kristof23', wait: true, hero_install: true)!
|
||||
|
||||
// this will put hero in debug mode on the system
|
||||
mut b := builder.new()!
|
||||
mut n := b.node_new(ipaddr: serverinfo.server_ip)!
|
||||
n.hero_install(compile: true)!
|
||||
|
||||
n.shell('')!
|
||||
@@ -8,12 +8,20 @@ hero git pull https://git.threefold.info/despiegk/hero_secrets
|
||||
source ~/code/git.ourworld.tf/despiegk/hero_secrets/mysecrets.sh
|
||||
```
|
||||
|
||||
## to e.g. install kristof 1
|
||||
## to e.g. install test1
|
||||
|
||||
```
|
||||
~/code/github/incubaid/herolib/examples/virt/hetzner/hetzner_kristof1.vsh
|
||||
~/code/github/incubaid/herolib/examples/virt/hetzner/hetzner_test1.vsh
|
||||
```
|
||||
|
||||
keys available:
|
||||
|
||||
- hossnys (RSA 2048)
|
||||
- Jan De Landtsheer (ED25519 256)
|
||||
- mahmoud (ED25519 256)
|
||||
- kristof (ED25519 256)
|
||||
- maxime (ED25519 256)
|
||||
|
||||
## hetzner info
|
||||
|
||||
get the login passwd from:
|
||||
|
||||
Reference in New Issue
Block a user