vagrant-linode 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjE5MThiZTU0ODg3ZGVmZjA2OTI4MWEzZWIxYTc2YWRkNTYxZDllZA==
5
- data.tar.gz: !binary |-
6
- NTRmMjI5MzdkNDg5YjBkNzI5NjhjZTA0ODdlN2RkMGNmMDBlNTQ3OA==
2
+ SHA1:
3
+ metadata.gz: 9e79120502b6fda82a12f08ad42c6b9ca167711f
4
+ data.tar.gz: 13e80103279fbae0a7e521e3f81426b7a539c2ba
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzBlMjc0ZGEyMDJmZTMwMDYzY2FlYTc4N2E0ZTBjMGVhOGFhNWJhMjhkZmYw
10
- YzQ4NWYwZWNlY2FhYjBiMGU2YzUxNjQxYWI1OTM1ODk5NjEyMmVkMjgyNTQw
11
- ZTU4OTIxODcwYzZjNzA1YjFhMTE3ODE4ODQxNjZmOGFiODBhNWE=
12
- data.tar.gz: !binary |-
13
- NjQwNmRjOTc3N2ZhZGI3MTcxM2RjM2YxYjExMmRhNGU3YzM4OWRjOTA2MTFm
14
- NjM4Mzk3N2E0YmIyMjdhOWNjZTJiNTczZDU1MDI2ZDc2OWVjZjdmZDU1MzBi
15
- NTQ5MGQ0ZjdhYWQ4YzNmMTdkM2E2ZGE4NTA5ODMwNDc2MDgxNTA=
6
+ metadata.gz: 63661d58fb59497f8017b370781ed289f2da809328d68475b79f55acb8b788a86299a9e2cc4622d794adf02fdebd33210f9c326cda10bc5930da321e947d57b7
7
+ data.tar.gz: ffd6a184e1f2f60dd0120d76568b4d699c5a8143c79d491fc7da62989175d79b809379a0d853356f00a5c3efa3ab5fe7a881b8b914ea86fad736f6a26d89239a
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git', tag: 'v1.6.3'
3
+ gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git', tag: 'v1.6.5'
4
4
  gem 'vagrant-omnibus'
5
5
  gem 'rake'
6
6
 
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  Linode Vagrant Provider
2
2
  ==============================
3
+
3
4
  `vagrant-linode` is a provider plugin for Vagrant that supports the
4
5
  management of [Linode](https://www.linode.com/) linodes
5
6
  (instances).
@@ -17,7 +18,7 @@ Current features include:
17
18
  - setup a SSH public key for authentication
18
19
  - create a new user account during linode creation
19
20
 
20
- The provider has been tested with Vagrant 1.1.5+ using Ubuntu 14.04 LTS and
21
+ The provider has been tested with Vagrant 1.6.3+ using Ubuntu 14.04 LTS and
21
22
  Debian 7.5 guest operating systems.
22
23
 
23
24
  Install
@@ -199,3 +200,9 @@ To run the provider's tests:
199
200
  You can now make modifications. Running `vagrant` within the Bundler
200
201
  environment will ensure that plugins installed in your Vagrant
201
202
  environment are not loaded.
203
+
204
+ [![Code Climate](https://codeclimate.com/github/displague/vagrant-linode/badges/gpa.svg)](https://codeclimate.com/github/displague/vagrant-linode)
205
+ [![Test Coverage](https://codeclimate.com/github/displague/vagrant-linode/badges/coverage.svg)](https://codeclimate.com/github/displague/vagrant-linode)
206
+ [![Gem Version](https://badge.fury.io/rb/vagrant-linode.svg)](http://badge.fury.io/rb/vagrant-linode)
207
+ [![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
208
+
@@ -118,11 +118,14 @@ module VagrantPlugins
118
118
  )
119
119
  end
120
120
 
121
+ # kernel id
122
+ kernel_id = @machine.provider_config.kernel_id
123
+
121
124
  config = @client.linode.config.create(
122
125
  linodeid: result['linodeid'],
123
126
  label: 'Vagrant Config',
124
127
  disklist: "#{disk['diskid']},#{swap['diskid']}",
125
- kernelid: 138 # default - newest @todo make this part of config..
128
+ kernelid: kernel_id
126
129
  )
127
130
 
128
131
  # @todo: allow provisioning to set static configuration for networking
@@ -130,9 +133,13 @@ module VagrantPlugins
130
133
  private_network = @client.linode.ip.addprivate linodeid: result['linodeid']
131
134
  end
132
135
 
136
+ label = @machine.provider_config.label
137
+ label = label || @machine.name if @machine.name != 'default'
138
+ label = label || get_server_name
139
+
133
140
  result = @client.linode.update(
134
141
  linodeid: result['linodeid'],
135
- label: @machine.config.vm.hostname || @machine.name
142
+ label: label
136
143
  )
137
144
 
138
145
  env[:ui].info I18n.t('vagrant_linode.info.booting', linodeid: result['linodeid'])
@@ -178,6 +185,11 @@ module VagrantPlugins
178
185
  # end
179
186
  # end
180
187
 
188
+ # generate a random name if server name is empty
189
+ def get_server_name
190
+ server_name = "vagrant_linode-#{rand.to_s.split('.')[1]}"
191
+ end
192
+
181
193
  def terminate(env)
182
194
  destroy_env = env.dup
183
195
  destroy_env.delete(:interrupted)
@@ -13,6 +13,8 @@ module VagrantPlugins
13
13
  attr_accessor :setup
14
14
  attr_accessor :xvda_size
15
15
  attr_accessor :swap_size
16
+ attr_accessor :kernel_id
17
+ attr_accessor :label
16
18
 
17
19
  alias_method :setup?, :setup
18
20
 
@@ -29,6 +31,8 @@ module VagrantPlugins
29
31
  @setup = UNSET_VALUE
30
32
  @xvda_size = UNSET_VALUE
31
33
  @swap_size = UNSET_VALUE
34
+ @kernel_id = UNSET_VALUE
35
+ @label = UNSET_VALUE
32
36
  end
33
37
 
34
38
  def finalize!
@@ -44,6 +48,8 @@ module VagrantPlugins
44
48
  @setup = true if @setup == UNSET_VALUE
45
49
  @xvda_size = true if @xvda_size == UNSET_VALUE
46
50
  @swap_size = '256' if @swap_size == UNSET_VALUE
51
+ @kernel_id = '138' if @kernel_id == UNSET_VALUE
52
+ @label = false if @label == UNSET_VALUE
47
53
  end
48
54
 
49
55
  def validate(machine)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Linode
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
data/test/Vagrantfile CHANGED
@@ -23,19 +23,23 @@ Vagrant.configure('2') do |config|
23
23
 
24
24
  # Disk Image Sizes (Optional configuration)
25
25
 
26
- # Main Disk Image Size
27
- # [str] ( Full Allocation - Swap ) if nil
28
- provider.xvda_size = '1024'
26
+ # Main Disk Image Size
27
+ # [str] ( Full Allocation - Swap ) if nil
28
+ provider.xvda_size = '1024'
29
29
 
30
- # Swap Image Size
31
- # [str] 256 if nil
32
- provider.swap_size = '256'
30
+ # Swap Image Size
31
+ # [str] 256 if nil
32
+ provider.swap_size = '256'
33
+
34
+ # Kernel Image ID
35
+ # [str] 138 if nil
36
+ provider.kernel_id = '138'
33
37
 
34
38
  # Networking (Optional Configuration)
35
39
 
36
- # Enable private networking
37
- # [boolean] disabled if nil
38
- #provider.private_networking = true
40
+ # Enable private networking
41
+ # [boolean] disabled if nil
42
+ #provider.private_networking = true
39
43
  end
40
44
 
41
45
  config.vm.provision :shell, path: 'scripts/provision.sh'
@@ -49,6 +53,9 @@ Vagrant.configure('2') do |config|
49
53
  config.vm.define :ubuntu do |ubuntu|
50
54
  ubuntu.vm.provider :linode do |provider|
51
55
  provider.distribution = 'Ubuntu 14.04 LTS'
56
+
57
+ # Optional Settings
58
+ provider.label = 'Vagrant-Ubuntu'
52
59
  end
53
60
  end
54
61
 
@@ -6,16 +6,23 @@ require 'vagrant-linode/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = 'vagrant-linode'
8
8
  gem.version = VagrantPlugins::Linode::VERSION
9
+ gem.licenses = ['MIT']
9
10
  gem.authors = ['Marques Johansson', 'Jonathan Leal']
10
11
  gem.email = ['marques@linode.com', 'jleal@linode.com']
11
12
  gem.description = 'Enables Vagrant to manage Linode linodes'
13
+ gem.homepage = 'https://www.github.com/displague/vagrant-linode'
12
14
  gem.summary = gem.description
13
15
 
16
+ gem.add_runtime_dependency 'linode'
17
+ gem.add_runtime_dependency 'json'
18
+ gem.add_runtime_dependency 'log4r'
19
+
20
+ gem.add_development_dependency "rake"
21
+ gem.add_development_dependency "rspec", "~> 2.14.0"
22
+ gem.add_development_dependency "aruba", "~> 0.5.4"
23
+
14
24
  gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
25
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
26
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
27
  gem.require_paths = ['lib']
17
-
18
- gem.add_dependency 'linode'
19
- gem.add_dependency 'json'
20
- gem.add_dependency 'log4r'
21
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-linode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marques Johansson
@@ -9,50 +9,92 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-24 00:00:00.000000000 Z
12
+ date: 2014-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: linode
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: json
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: log4r
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 2.14.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 2.14.0
84
+ - !ruby/object:Gem::Dependency
85
+ name: aruba
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 0.5.4
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 0.5.4
56
98
  description: Enables Vagrant to manage Linode linodes
57
99
  email:
58
100
  - marques@linode.com
@@ -61,7 +103,7 @@ executables: []
61
103
  extensions: []
62
104
  extra_rdoc_files: []
63
105
  files:
64
- - .gitignore
106
+ - ".gitignore"
65
107
  - CHANGELOG.md
66
108
  - Gemfile
67
109
  - LICENSE.txt
@@ -100,8 +142,9 @@ files:
100
142
  - test/test_id_rsa
101
143
  - test/test_id_rsa.pub
102
144
  - vagrant-linode.gemspec
103
- homepage:
104
- licenses: []
145
+ homepage: https://www.github.com/displague/vagrant-linode
146
+ licenses:
147
+ - MIT
105
148
  metadata: {}
106
149
  post_install_message:
107
150
  rdoc_options: []
@@ -109,17 +152,17 @@ require_paths:
109
152
  - lib
110
153
  required_ruby_version: !ruby/object:Gem::Requirement
111
154
  requirements:
112
- - - ! '>='
155
+ - - ">="
113
156
  - !ruby/object:Gem::Version
114
157
  version: '0'
115
158
  required_rubygems_version: !ruby/object:Gem::Requirement
116
159
  requirements:
117
- - - ! '>='
160
+ - - ">="
118
161
  - !ruby/object:Gem::Version
119
162
  version: '0'
120
163
  requirements: []
121
164
  rubyforge_project:
122
- rubygems_version: 2.4.1
165
+ rubygems_version: 2.2.2
123
166
  signing_key:
124
167
  specification_version: 4
125
168
  summary: Enables Vagrant to manage Linode linodes