Get the App
SLTechnology News&Howtos  ›  Development  › 

How to manage DigitalOcean CVM by Vagrant

Shulou Source: shulou.com Published: 2022-06-01 13:48:47 09月16日 Update

This article mainly shows you "how Vagrant manages DigitalOcean CVMs". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how Vagrant manages DigitalOcean CVMs".

To put it simply, vagrant is a tool for manipulating virtual machines. It provides a set of efficient and convenient virtual machine management. Through commands and configuration files, and of course, based on the agreement of vagrant itself, it can quickly complete the deployment of a set of development environment, and can be packaged and propagated, which greatly facilitates the inconsistency of various development environments in the work environment, and solves the waste of repeated configuration environment.

How to use this plug-in

The first step on the command line is to install the software.

$sudo dnf install-y vagrant-digitalocean

After the installation is complete, the next step is to create a local Vagrantfile file. Here is an example.

$mkdir digitalocean$ cd digitalocean$ cat VagrantfileVagrant.configure ('2') do | config | config.vm.hostname = 'dropletname.kushaldas.in' # Alternatively, use provider.name below to set the Droplet name. Config.vm.hostname takes precedence. Config.vm.provider: digital_ocean do | provider Override | override.ssh.private_key_path ='/ home/kdas/.ssh/id_rsa' override.vm.box = 'digital_ocean' override.vm.box_url = "https://github.com/devopsgroup-io/vagrant- digitalocean/raw/master/box/digital_ocean.box" provider.token =' Your AUTH Token' provider.image = 'fedora-23-x64' provider.region =' nyc2' provider.size = '512mb' provider.ssh_key _ name = 'considerations for the Kushal' endendVagrant DigitalOcean plug-in

A few key naming conventions for SSH to keep in mind: if you have uploaded the key to DigitalOcean, make sure that provider.ssh_key_name matches the name that is already on the server. Specific documentation for provider.image can be found at DigitalOcean documentation. You can create AUTH tokens in the App & API section of the control panel.

You can start an instance using the following command.

$vagrant up-provider=digital_ocean

This command starts a server instance in DigitalOcean. You can then log in to this instance using the vagrant ssh command to ssh. You can execute vagrant destroy to delete this instance.

The above is all the contents of the article "how Vagrant manages DigitalOcean CVMs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Commands management instances environment hosts content articles plug-ins files servers learning help development services configuration consistency matters tokens examples keys Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Docker OPPO Reno macOS Shulou Technology