Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Não consigo subir a máquina na aws

Quando dou vagrant up aws_web --provider=aws, aparece o seguinte erro:

C:/Users/mayum/.vagrant.d/gems/2.7.4/gems/vagrant-aws-0.7.2/lib/vagrant-aws/action/connect_aws.rb:41:in `call': undefined method `except' for #<Hash:0x00000169124b1a28> (NoMethodError)
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/action/warden.rb:48:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/action/warden.rb:48:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/action/builder.rb:149:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/action/runner.rb:89:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/action/runner.rb:89:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:246:in `action_raw'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:215:in `block in action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:197:in `block in action'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:201:in `action'
        from C:/Users/mayum/.vagrant.d/gems/2.7.4/gems/vagrant-aws-0.7.2/lib/vagrant-aws/provider.rb:32:in `state'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:541:in `state'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/machine.rb:154:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:81:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:81:in `machine'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:716:in `machine'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/plugin/v2/command.rb:180:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/plugin/v2/command.rb:204:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/plugin/v2/command.rb:186:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/plugin/v2/command.rb:186:in `with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/commands/up/command.rb:87:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/cli.rb:67:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:290:in `cli'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:231:in `<main>'

Meu Vagrantfile:

Vagrant.configure("2") do |config|

  config.vm.provider "virtualbox"
  config.vm.provider "aws"

  config.vm.provider :aws do |aws, override|

    aws.access_key_id = "xxx"
    aws.secret_access_key = "xxx"

    aws.ami = "ami-0e472ba40eb589f49"

    aws.security_groups = ['devops-vagrant']

    aws.keypair_name = "devops-key"

    aws.instance_type = "t2.micro"
      aws.region = "us-east-1"

    override.ssh.username = "ubuntu"

    #caminho e nome do arquivo pem
    override.ssh.private_key_path = "devops-key.pem"
  end

  #novo ambiente aws_web, ainda sem puppet
  config.vm.define :aws_web do |aws_web_config|
    aws_web_config.vm.box = "dummy"
    aws_web_config.vm.synced_folder '.', '/vagrant', type: "rsync", disabled: true
    aws_web_config.vm.provider :aws do |aws|
        aws.tags = { 'Name' => 'MusicJungle (vagrant)'}
    end
  end

E acredito que o plugin da aws tenha sido instalada corretamente (mensagem após a instalação):

Installing the 'fog-aws' plugin. This can take a few minutes...
Building native extensions. This could take a while...
------------------------------
Thank you for installing fog!

IMPORTANT NOTICE:
If there's a metagem available for your cloud provider, e.g. `fog-aws`,
you should be using it instead of requiring the full fog collection to avoid
unnecessary dependencies.

'fog' should be required explicitly only if:
- The provider you use doesn't yet have a metagem available.
- You require Ruby 1.9.3 support.
------------------------------
Installed the plugin 'fog-aws (2.0.1)'!

Alguém sabe dizer o que tá acontecendo e como corrigir?

1 resposta
solução!

Oi Evelyn, tudo bem?

Desculpe a demora em retornar.

Pelo erro apresentado, parece que há um problema com o método except em um arquivo do plugin do Vagrant para AWS. Isso pode ser causado por uma incompatibilidade entre a versão do plugin e a versão do Vagrant que você está usando.

Uma possível solução é atualizar o plugin do Vagrant para AWS. Você pode fazer isso executando o seguinte comando na linha de comando:

vagrant plugin update vagrant-aws

Isso irá atualizar o plugin para a versão mais recente disponível.

Se isso não resolver o problema, pode ser necessário verificar se há alguma incompatibilidade entre as versões do Vagrant e do plugin do Vagrant para AWS que você está usando. Verifique se as versões são compatíveis entre si.

Além disso, certifique-se de que todas as dependências necessárias estão instaladas corretamente. No seu caso, parece que o plugin fog-aws foi instalado corretamente.

Um abraço e bons estudos.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software