Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
5
Help us understand the problem. What is going on with this article?
@aminamid

vagrantでサイズの異なるdigital_oceanのホストを複数生成する

More than 5 years have passed since last update.

vagrantでdigital_oceanを使ってサイズの異なる複数のホストを生成する例

以下のとおり

Vagrantfile
Vagrant.configure('2') do |config|

  config.vm.provider :digital_ocean do |provider, override|
    override.ssh.private_key_path = '~/.ssh/id_rsa'
    override.vm.box               = 'digital_ocean'
    override.vm.box_url           = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
    provider.private_networking   = true
    provider.client_id            = 'abc'
    provider.api_key              = 'xyz'
    provider.image                = 'CentOS 6.5 x64'
    provider.region               = 'Singapore 1'
    provider.ca_path              = '/path/to/ca'
    provider.ssh_key_name         = 'keyname'
  end

  hosts=[]
  (1..3).each {|x| hosts.push({"name"=>"cass#{x}", "size"=>"4GB"}) }
  (1..1).each {|x| hosts.push({"name"=>"spv#{x}" , "size"=>"2GB"}) }
  (1..2).each {|x| hosts.push({"name"=>"node#{x}", "size"=>"2GB"}) }

  hosts.each do |host|
    config.vm.define host["name"] do |server|
      config.vm.hostname          = host["name"]
      config.vm.provider :digital_ocean do |provider|
        provider.size = host["size"]
      end
    end
  end

end
5
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
aminamid

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
5
Help us understand the problem. What is going on with this article?