Templates¶
initialize virtual machines¶
- use --apply-file (-a in short) to execute an initialization script
- use --cloud-init (-i in short) to set cloud-init script on virtual machines startup.
bash¶
-
use your own script.
to use the fileonctl up -a scripts/init.sh
scripts/init.sh
in your current directory. -
use onctl-templates repo.
files on the
onctl-templates
repo can be access directly by using the relative path.onctl up -a wireguard/vpn.sh # https://templates.onctl.com/wireguard/vpn.sh
-
use any external source as a HTTP URL.
any file that is accessiable via URL can be used.
to use the embeded file. Embeded files can be found underonctl up -a https://gist.githubusercontent.com/cdalar/dabdc001059089f553879a7b535e9b21/raw/02f336857b04eb13bc7ceeec1e66395bd615824b/helloworld.sh
internal/files/
in repository.
cloud-init¶
check: cloud-init docs
To set a cloud-init configuration to your virtual machine. Just add --cloud-init
flag to your command.
ex. this command will set the ssh port to 443.
onctl up -a wireguard/vpn.sh --cloud-init cloud-init-ssh-443.config
precedence on scripts¶
- local file
- embeded files
- files on onctl-templates repo
- as defined on URL (https://example.com)