- Update example configuration comments - Refactor server rescue check to use file_exists - Add Ubuntu installation timeout and polling constants - Implement non-interactive installation script execution - Enhance SSH execution with argument parsing - Add check to skip reinstallation if Ubuntu is already installed - Copy SSH key to new system during installation - Poll for installation completion with progress updates - Use `node.exec` instead of `node.exec_interactive` - Use `execvp` correctly for shell execution - Recreate node connection after server reboot - Adjust SSH wait timeout to milliseconds
35 lines
986 B
Plaintext
Executable File
35 lines
986 B
Plaintext
Executable File
#!/usr/bin/env hero
|
|
|
|
// # Configure HetznerManager, replace with your own credentials, server id's and ssh key name and all other parameters
|
|
|
|
!!hetznermanager.configure
|
|
user:"user_name"
|
|
whitelist:"server_id"
|
|
password:"password"
|
|
sshkey:"ssh_key_name"
|
|
|
|
!!hetznermanager.server_rescue
|
|
server_name: 'server_name' // The name of the server to manage (or use `id`)
|
|
wait: true // Wait for the operation to complete
|
|
hero_install: true // Automatically install Herolib in the rescue system
|
|
|
|
|
|
// # Reset a server
|
|
!!hetznermanager.server_reset
|
|
instance: 'main'
|
|
server_name: 'server_name'
|
|
wait: true
|
|
|
|
// # Add a new SSH key to your Hetzner account
|
|
!!hetznermanager.key_create
|
|
instance: 'main'
|
|
key_name: 'ssh_key_name'
|
|
data: 'ssh-rsa AAAA...'
|
|
|
|
|
|
// Install Ubuntu 24.04 on a server
|
|
!!hetznermanager.ubuntu_install
|
|
server_name: 'server_name'
|
|
wait: true
|
|
hero_install: true // Install Herolib on the new OS
|