vagrant-simple_cloud 0.0.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b790ea47dcbbb09f249b74ef02d2b3996660e46
4
- data.tar.gz: d2b81d154a650954572270b2aa0a6ecb448d44bd
3
+ metadata.gz: a641b4e0ec72e22f9dd841ef357c111a333c993c
4
+ data.tar.gz: e168c81888d9116b81358828378a6d182d5849c9
5
5
  SHA512:
6
- metadata.gz: 22df6ac60ba4a1aadb4d977e36b23254cbd2dbd6bc9111bd44bcfe5c98cab278234926e2717f08842390666985051c20f2da734d477268a2efbaa707fffaa02b
7
- data.tar.gz: f275bd242800b4d66b879d2cf36155f44b90a60a2cb48bb5ee464969c9c920fe35724ee09fb66a52b958a642dc8e0b5fbc908ec925709d7b173484105f9d95e3
6
+ metadata.gz: 99ca891e004ef6a97c438d9c5fce74df987657fee29a8af3a0dc00ecae9bd92223b82aaa60b422a9137076885de7e5e8613fe4c7d2e780f21ffe6d9828a95a47
7
+ data.tar.gz: f76525a025183c95a536fd3588e01c368321701d2ff0e82041cb5084f030dfe3c51428a53b61adad7473e3a3f6c116270502f0e28c918996436f1af9a7b5a66e
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ vagrant-simple_cloud.iml
11
+ .idea
@@ -26,6 +26,18 @@ module VagrantPlugins
26
26
  # refresh droplet state with provider
27
27
  Provider.droplet(@machine, :refresh => true)
28
28
 
29
+ # wait for ssh to be ready
30
+ switch_user = @machine.provider_config.setup?
31
+ user = @machine.config.ssh.username
32
+ @machine.config.ssh.username = 'root' if switch_user
33
+
34
+ retryable(:tries => 120, :sleep => 10) do
35
+ next if env[:interrupted]
36
+ raise 'not ready' if !@machine.communicate.ready?
37
+ end
38
+
39
+ @machine.config.ssh.username = user
40
+
29
41
  @app.call(env)
30
42
  end
31
43
  end
@@ -23,6 +23,18 @@ module VagrantPlugins
23
23
  env[:ui].info I18n.t('vagrant_simple_cloud.info.reloading')
24
24
  @client.wait_for_event(env, result['action']['id'])
25
25
 
26
+ # wait for ssh to be ready
27
+ switch_user = @machine.provider_config.setup?
28
+ user = @machine.config.ssh.username
29
+ @machine.config.ssh.username = 'root' if switch_user
30
+
31
+ retryable(:tries => 120, :sleep => 10) do
32
+ next if env[:interrupted]
33
+ raise 'not ready' if !@machine.communicate.ready?
34
+ end
35
+
36
+ @machine.config.ssh.username = user
37
+
26
38
  @app.call(env)
27
39
  end
28
40
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module SimpleCloud
3
- VERSION = '0.0.6'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
data/test/Vagrantfile CHANGED
@@ -1,24 +1,14 @@
1
1
  Vagrant.require_plugin('vagrant-simple_cloud')
2
2
 
3
3
  Vagrant.configure('2') do |config|
4
-
5
- config.ssh.username = 'tester'
6
- config.ssh.private_key_path = 'test_id_rsa'
7
-
8
- config.vm.synced_folder '.', '/vagrant', :disabled => true
9
-
10
- config.vm.provider :simple_cloud do |provider, override|
11
- override.vm.box = 'simple_cloud'
12
- provider.token = ENV['DO_TOKEN']
13
- provider.serviceaddr = 'http://localhost/'
14
- provider.ssh_key_name = 'Test Key'
15
- end
16
-
17
- config.vm.provision :shell, :path => 'scripts/provision.sh'
18
-
19
- config.vm.define :ubuntu do |ubuntu|
20
- ubuntu.vm.provider :simple_cloud do |provider|
21
- provider.image = '26'
4
+ config.vm.define "test" do |t|
5
+ t.vm.provider :simple_cloud do |provider, override|
6
+ override.ssh.private_key_path = 'test_id_rsa'
7
+ override.vm.box = 'simple_cloud'
8
+ override.vm.hostname = 'test'
9
+ override.vm.provision :shell, :path => 'scripts/provision.sh'
10
+
11
+ provider.token = ENV['DO_TOKEN']
22
12
  end
23
13
  end
24
14
  end
data/test/test_id_rsa.pub CHANGED
@@ -1 +1 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbFlHJ++BcXGU9b2K+jF990r16uqkKnWiK2CFS0PFvM9IJs3CoGiIlyc9UD9O4LEyeu5Rw0RdiAp9MvyUPcDUeibw3WlMCFJ53mbioAapMy5tPXmxxJH5KcN2uJKESsH/1hJv0tWfVpHQywVLcf/7HWPjDl3qEFqzwGEN+5V3XqyG+hoA4rLTLDL40G68bL/oC7ere3sz3B16U4NGdgtJZapot5gTFErFZZztql76h25Ch7isE1XAaYg6NY4z1oU8Q9Ud0sY74tDI8TF165LStb3prf1TinwaMbOyuQ1wrNU4aMzekiwazeo6LtHMnfPjweIGP01PwjZ8WkYcRF6tt digital_ocean provider test key
1
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbFlHJ++BcXGU9b2K+jF990r16uqkKnWiK2CFS0PFvM9IJs3CoGiIlyc9UD9O4LEyeu5Rw0RdiAp9MvyUPcDUeibw3WlMCFJ53mbioAapMy5tPXmxxJH5KcN2uJKESsH/1hJv0tWfVpHQywVLcf/7HWPjDl3qEFqzwGEN+5V3XqyG+hoA4rLTLDL40G68bL/oC7ere3sz3B16U4NGdgtJZapot5gTFErFZZztql76h25Ch7isE1XAaYg6NY4z1oU8Q9Ud0sY74tDI8TF165LStb3prf1TinwaMbOyuQ1wrNU4aMzekiwazeo6LtHMnfPjweIGP01PwjZ8WkYcRF6tt simple_cloud provider test key
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-simple_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bender
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-02-03 00:00:00.000000000 Z
13
+ date: 2017-04-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.6.8
118
+ rubygems_version: 2.5.1
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Enables Vagrant to manage SimpleCloud droplets. Based on https://github.com/devopsgroup-io/vagrant-digitalocean.