module

Beryl::CLI::Vrack

beryl vrack <host> [--attach] : interroge l'API OVH pour savoir si le serveur d'un host est dans un vRack, et le rattache avec --attach.

beryl vrack han.example.net # statut seulement beryl vrack han.example.net --attach # essai à blanc beryl vrack han.example.net --attach --apply # rattache (task async + suivi) beryl vrack han.example.net --attach --vrack pn-12345 --apply beryl vrack han.example.net --via=zgra [--apply] # rôle d'accès SSH imposé beryl vrack han.example.net --public | --bastion [--apply]

Constants

EXIT_FAIL = 2
EXIT_OK = 0
EXIT_UNEXPECTED = 3
EXIT_USAGE = 1
POLL_INTERVAL = 5.seconds
POLL_MAX = 36

Class methods

derive_proxy_jump(connect_user : String, bastion : String, domain : String) : String

Dérive la chaîne proxy_jump <user>@<bastion-fqdn> depuis le nom (court OU FQDN) du bastion et le domaine du host caché. Pur.

Source
derive_subnet(ip : String) : String

Dérive le /24 d'une IP (ex. 192.168.42.31 → 192.168.42.0/24). Pur.

Source
remove_vrack_field(content : String, key : String) : String

Retire key: du bloc vrack: (et le bloc s'il devient vide). No-op si absent. Retourne le nouveau contenu.

Source
run(config_root : String, args : Array(String)) : Int32
Source
upsert_vrack_field(content : String, key : String, value : String) : String

Pose/maj key: value dans le bloc vrack: (indenté 2 espaces), en préservant le reste. Crée le bloc vrack: s'il est absent (avant apply_recipes: si présent, sinon en fin). Retourne le nouveau contenu.

Source