vagrant-linode 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8ce03d21b5be2ac13a6492b31874c435dced26f
4
- data.tar.gz: 4662545d18c8e288c37bb3f085306239865b8a09
3
+ metadata.gz: 10e005fdd16d23255cbc89613cf419a133fb729e
4
+ data.tar.gz: 035816e2ee03ce0698b0de6ab6c1dc0a09cd0a13
5
5
  SHA512:
6
- metadata.gz: fbee5ac73c4c72a2f8518a775e895c64e420901ff3eb9e2d5dec78d3a0eb65d1cd66dc7b31dd05c754f63f2942aed694bedda10cc62e5e9ed33dad391e3b6969
7
- data.tar.gz: 5f31d483d567d7bbdbb9a8548288f56748adf2172c00062a6e74c62f851e5ddf5f36723c76fb9bf4f1ef8fe2e90a1e04c2a4908980a366403a3c23ffc919c84e
6
+ metadata.gz: d415ef59813703bdba199ff25eabaf39296ada14651591c07c3b207186de626671d19470b48abc47e02c3711a237a8c02e780e4c5636757574b358400cc5bd57
7
+ data.tar.gz: 4961ed7a4f26c6e0ccf640c0b296df80104e7cc742c9661c410715dd8533b52ad73de435753ef0b98cf10e0a445f1e218658d8ed18fd6e69b4e84e8fe24f260f
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.5'
3
+ gem 'vagrant', git: 'git://github.com/mitchellh/vagrant.git', tag: 'v1.7.2'
4
4
  gem 'vagrant-omnibus'
5
5
  gem 'rake'
6
6
 
data/README.md CHANGED
@@ -5,21 +5,17 @@ Linode Vagrant Provider
5
5
  management of [Linode](https://www.linode.com/) linodes
6
6
  (instances).
7
7
 
8
- **NOTE:** The Chef provisioner is no longer supported by default (as of 0.2.0).
9
- Please use the `vagrant-omnibus` plugin to install Chef on Vagrant-managed
10
- machines. This plugin provides control over the specific version of Chef
11
- to install.
12
-
13
8
  Current features include:
14
9
  - create and destroy linodes
15
10
  - power on and off linodes
16
11
  - rebuild a linode
17
- - provision a linode with the shell or Chef provisioners
12
+ - provision a linode with the shell or other provisioners
18
13
  - setup a SSH public key for authentication
19
14
  - create a new user account during linode creation
15
+ - setup hostname during creation
20
16
 
21
17
  The provider has been tested with Vagrant 1.6.3+ using Ubuntu 14.04 LTS and
22
- Debian 7.5 guest operating systems.
18
+ Debian 7.5+ guest operating systems.
23
19
 
24
20
  Install
25
21
  -------
@@ -68,6 +64,8 @@ Vagrant.configure('2') do |config|
68
64
  # provider.datacenterid = <int>
69
65
  # provider.image = <string>
70
66
  # provider.imageid = <int>
67
+ # provider.kernel = <string>
68
+ # provider.kernelid = <int>
71
69
  # provider.private_networking = <boolean>
72
70
  # provider.stackscript = <string>
73
71
  # provider.stackscriptid = <int>
@@ -82,7 +80,7 @@ Please note the following:
82
80
  your public key which is assumed to be the `private_key_path` with a *.pub*
83
81
  extension.
84
82
  - You *must* specify your Linode Personal Access Token. This may be
85
- found on the control panel within the *Apps &amp; API* section.
83
+ found on the control panel within the *my profile* &gt; *API Keys* section.
86
84
 
87
85
  **Supported Configuration Attributes**
88
86
 
@@ -165,6 +163,20 @@ curl -X POST "https://api.linode.com/?api_action=avail.datacenters" \
165
163
 
166
164
  More detail: [Linode API - Datacenters](https://www.linode.com/api/utility/avail.datacenters)
167
165
 
166
+ ### provider.kernel
167
+
168
+ The kernel can be specified using the *kernelid* provider parameter, or with *kernel* which
169
+ will use a partial text match.
170
+
171
+ ```
172
+ curl -X POST "https://api.linode.com/?api_action=avail.kernels" \
173
+ --data-ascii api_key="$LINODE_API_KEY" \
174
+ 2>/dev/null | jq '.DATA [] | .KERNELID,.LABEL'
175
+ ```
176
+
177
+ More detail: [Linode API - Kernels](https://www.linode.com/api/utility/avail.kernels)
178
+
179
+
168
180
  Run
169
181
  ---
170
182
  After creating your project's `Vagrantfile` with the required configuration
@@ -193,6 +205,12 @@ The provider supports the following Vagrant sub-commands:
193
205
  - `vagrant status` - Outputs the status (active, off, not created) for the
194
206
  linode instance.
195
207
 
208
+
209
+ More Docs and Tools
210
+ -------------------
211
+ [Linode Guides and Tutorials - Using Vagrant to Manage Linode Environments](https://linode.com/docs/applications/configuration-management/vagrant-linode-environments)
212
+ [Puphpet - Online Vagrantfile Generator](https://puphpet.com/#vagrantfile-linode)
213
+
196
214
  Contribute
197
215
  ----------
198
216
  To contribute, clone the repository, and use [Bundler](http://gembundler.com)
@@ -38,6 +38,15 @@ module VagrantPlugins
38
38
  distribution_id = @machine.provider_config.distributionid
39
39
  end
40
40
 
41
+ if @machine.provider_config.kernel
42
+ kernels = @client.avail.kernels
43
+ kernel = kernels.find { |k| k.label.downcase.include? @machine.provider_config.kernel.downcase }
44
+ raise( Errors::KernelMatch, kernel: @machine.provider_config.kernel.to_s ) if kernel == nil
45
+ kernel_id = kernel.kernelid || nil
46
+ else
47
+ kernel_id = @machine.provider_config.kernelid
48
+ end
49
+
41
50
  if @machine.provider_config.datacenter
42
51
  datacenters = @client.avail.datacenters
43
52
  datacenter = datacenters.find { |d| d.abbr == @machine.provider_config.datacenter }
@@ -118,9 +127,6 @@ module VagrantPlugins
118
127
  )
119
128
  end
120
129
 
121
- # kernel id
122
- kernel_id = @machine.provider_config.kernel_id
123
-
124
130
  config = @client.linode.config.create(
125
131
  linodeid: result['linodeid'],
126
132
  label: 'Vagrant Config',
@@ -14,6 +14,7 @@ module VagrantPlugins
14
14
  attr_accessor :xvda_size
15
15
  attr_accessor :swap_size
16
16
  attr_accessor :kernel_id
17
+ attr_accessor :kernel
17
18
  attr_accessor :label
18
19
  attr_accessor :group
19
20
 
@@ -33,6 +34,7 @@ module VagrantPlugins
33
34
  @xvda_size = UNSET_VALUE
34
35
  @swap_size = UNSET_VALUE
35
36
  @kernel_id = UNSET_VALUE
37
+ @kernel = UNSET_VALUE
36
38
  @label = UNSET_VALUE
37
39
  @group = UNSET_VALUE
38
40
  end
@@ -50,7 +52,7 @@ module VagrantPlugins
50
52
  @setup = true if @setup == UNSET_VALUE
51
53
  @xvda_size = true if @xvda_size == UNSET_VALUE
52
54
  @swap_size = '256' if @swap_size == UNSET_VALUE
53
- @kernel_id = '138' if @kernel_id == UNSET_VALUE
55
+ @kernel = 'Latest 64 bit' if @kernel == UNSET_VALUE and @kernel_id == UNSET_VALUE
54
56
  @label = false if @label == UNSET_VALUE
55
57
  @group = false if @group == UNSET_VALUE
56
58
  end
@@ -16,6 +16,10 @@ module VagrantPlugins
16
16
  class DistroMatch < LinodeError
17
17
  error_key(:distro_match)
18
18
  end
19
+
20
+ class KernelMatch < LinodeError
21
+ error_key(:kernel_match)
22
+ end
19
23
 
20
24
  class JSONError < LinodeError
21
25
  error_key(:json)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Linode
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -89,6 +89,9 @@ en:
89
89
  distro_match: !-
90
90
  The provider does not support your configurations chosen Distribution %{distro}.
91
91
  Supported distributions can be found at the following url - https://www.linode.com/distributions
92
+ kernel_match: !-
93
+ The provider does not support your configurations chosen Kernel %{kernel}.
94
+ Supported kernels can be found at the following url - https://www.linode.com/kernels
92
95
  disk_size: !-
93
96
  The space which you have specified for your Disk Images is too large for your
94
97
  plans allocations. Current = %{current}MB, Max = %{max}
data/test/Vagrantfile CHANGED
@@ -34,7 +34,8 @@ Vagrant.configure('2') do |config|
34
34
 
35
35
  # Kernel Image ID
36
36
  # [str] 138 if nil
37
- provider.kernel_id = '138'
37
+ # provider.kernel_id = '138'
38
+ provider.kernel = 'Latest 64 bit'
38
39
 
39
40
  # Networking (Optional Configuration)
40
41
 
@@ -13,13 +13,13 @@ Gem::Specification.new do |gem|
13
13
  gem.homepage = 'https://www.github.com/displague/vagrant-linode'
14
14
  gem.summary = gem.description
15
15
 
16
- gem.add_runtime_dependency 'linodeapi'
17
- gem.add_runtime_dependency 'json'
18
- gem.add_runtime_dependency 'log4r'
16
+ gem.add_runtime_dependency 'linodeapi', '~> 0.1.1'
17
+ gem.add_runtime_dependency 'json', '~> 1.8.3'
18
+ gem.add_runtime_dependency 'log4r', '~> 1.1.10'
19
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"
20
+ gem.add_development_dependency 'rake', '~> 10.4.2'
21
+ gem.add_development_dependency 'rspec', '~> 2.14.0'
22
+ gem.add_development_dependency 'aruba', '~> 0.5.4'
23
23
 
24
24
  gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
25
25
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marques Johansson
@@ -9,64 +9,64 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-25 00:00:00.000000000 Z
12
+ date: 2015-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: linodeapi
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 0.1.1
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
- version: '0'
27
+ version: 0.1.1
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
- version: '0'
34
+ version: 1.8.3
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
- version: '0'
41
+ version: 1.8.3
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
- version: '0'
48
+ version: 1.1.10
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
- version: '0'
55
+ version: 1.1.10
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">="
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '0'
62
+ version: 10.4.2
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: 10.4.2
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement