vagrant-linode 0.2.5 → 0.2.6

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: e1f6930e7ece744f93f6eedaedab23c5fcb5fba2
4
- data.tar.gz: 8420b21d58fed7ce446a029f1bbc8e53111a42e0
3
+ metadata.gz: d69d729a4e0d62d3e6a9e7b0b21ecdb80995b37b
4
+ data.tar.gz: d607202c4ff6ef28c01612ca7888cf20ad91cc46
5
5
  SHA512:
6
- metadata.gz: de302d8cd12bc85e080f944898d80811b5201d24346177dd274251fc5b427563fb19103739419a1878d4973eca2e88e30bd01a079534d98ef9238b8fb51d4bec
7
- data.tar.gz: b8bed5e966d2a134b304697b12895d4c0d7eb0abce2ff46a45e64641087083b7119c4fca8789d31498d517c0fe4fbfbfb386af4d7df05a1e970425fd6a08ba19
6
+ metadata.gz: dc76f6878e29e12e0ed2608b07bae18938bdfb843be758a70439f08b1903bea6fd2b456c54a5acbebd8580798cf66d1d5108d124df0dc235c60d5d9b91ed2a3e
7
+ data.tar.gz: eaeb9a36d82212a329d25338fdd70af8b972d97641ff431adb8ae78d18ad9c206016dc0df06c601af40d4f346c6be05be66fa32a7a027e84127e1781bac2f3a2
data/README.md CHANGED
@@ -171,6 +171,11 @@ curl -X POST "https://api.linode.com/?api_action=avail.kernels" \
171
171
 
172
172
  More detail: [Linode API - Kernels](https://www.linode.com/api/utility/avail.kernels)
173
173
 
174
+ ### nfs.functional
175
+
176
+ The sync provider, NFS, has been disabled to make rsync easier to use. To enable NFS,
177
+ run Vagrant with an environment variable `LINODE_NFS_FUNCTIONAL=1`. This will require
178
+ a bit more configuration between the Linode and the Vagrant host.
174
179
 
175
180
  Run
176
181
  ---
data/box/README.md CHANGED
@@ -11,3 +11,9 @@ $ tar cvzf linode.box ./metadata.json ./Vagrantfile
11
11
  This box works by using Vagrant's built-in Vagrantfile merging to setup
12
12
  defaults for Linode. These defaults can easily be overwritten by higher-level
13
13
  Vagrantfiles (such as project root Vagrantfiles).
14
+
15
+ # Test
16
+
17
+ ```
18
+ vagrant box add --name linode_test linode.box
19
+ ```
data/box/linode.box CHANGED
Binary file
data/box/metadata.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- provider: 'linode'
2
+ "provider": "linode"
3
3
  }
@@ -16,7 +16,7 @@ module VagrantPlugins
16
16
  end
17
17
 
18
18
  def call(env)
19
- @client = env[:linode_api]
19
+ @client = env[:linode_api]
20
20
  ssh_key_id = env[:machine].config.ssh.private_key_path
21
21
  ssh_key_id = ssh_key_id[0] if ssh_key_id.is_a?(Array)
22
22
  if ssh_key_id
@@ -29,6 +29,23 @@ module VagrantPlugins
29
29
  root_pass = Digest::SHA2.new.update(@machine.provider_config.api_key).to_s
30
30
  end
31
31
 
32
+ if @machine.provider_config.stackscript
33
+ stackscripts = @client.stackscript.list + @client.avail.stackscripts
34
+ stackscript = stackscripts.find { |s| s.label.downcase == @machine.provider_config.stackscript.to_s.downcase }
35
+ fail(Errors::StackscriptMatch, stackscript: @machine.provider_config.stackscript.to_s) if stackscript.nil?
36
+ stackscript_id = stackscript.stackscriptid || nil
37
+ else
38
+ stackscript_id = @machine.provider_config.stackscriptid
39
+ end
40
+
41
+ stackscript_udf_responses = @machine.provider_config.stackscript_udf_responses
42
+
43
+ if stackscript_udf_responses and !stackscript_udf_responses.is_a?(Hash)
44
+ fail(Errors::StackscriptUDFFormat, format: stackscript_udf_responses.class.to_s)
45
+ else
46
+ stackscript_udf_responses = @machine.provider_config.stackscript_udf_responses or {}
47
+ end
48
+
32
49
  if @machine.provider_config.distribution
33
50
  distributions = @client.avail.distributions
34
51
  distribution = distributions.find { |d| d.label.downcase.include? @machine.provider_config.distribution.downcase }
@@ -50,7 +67,7 @@ module VagrantPlugins
50
67
  image = images.find { |i| i.label.downcase.include? @machine.provider_config.image.downcase }
51
68
  fail Errors::ImageMatch, image: @machine.provider_config.image.to_s if image.nil?
52
69
  image_id = image.imageid || nil
53
- end
70
+ end
54
71
 
55
72
  if @machine.provider_config.kernel
56
73
  kernels = @client.avail.kernels
@@ -114,7 +131,26 @@ module VagrantPlugins
114
131
  # assign the machine id for reference in other commands
115
132
  @machine.id = result['linodeid'].to_s
116
133
 
117
- if distribution_id
134
+ if stackscript_id
135
+ swap = @client.linode.disk.create(
136
+ linodeid: result['linodeid'],
137
+ label: 'Vagrant swap',
138
+ type: 'swap',
139
+ size: swap_size
140
+ )
141
+
142
+ disk = @client.linode.disk.createfromstackscript(
143
+ linodeid: result['linodeid'],
144
+ stackscriptid: stackscript_id,
145
+ stackscriptudfresponses: JSON.dump(stackscript_udf_responses),
146
+ distributionid: distribution_id,
147
+ label: 'Vagrant Disk Distribution ' + distribution_id.to_s + ' Linode ' + result['linodeid'].to_s,
148
+ type: 'ext4',
149
+ size: xvda_size,
150
+ rootsshkey: pubkey,
151
+ rootpass: root_pass
152
+ )
153
+ elsif distribution_id
118
154
  swap = @client.linode.disk.create(
119
155
  linodeid: result['linodeid'],
120
156
  label: 'Vagrant swap',
@@ -17,6 +17,9 @@ module VagrantPlugins
17
17
  attr_accessor :ca_path
18
18
  attr_accessor :ssh_key_name
19
19
  attr_accessor :setup
20
+ attr_accessor :stackscriptid
21
+ attr_accessor :stackscript
22
+ attr_accessor :stackscript_udf_responses
20
23
  attr_accessor :xvda_size
21
24
  attr_accessor :swap_size
22
25
  attr_accessor :kernelid
@@ -34,9 +37,12 @@ module VagrantPlugins
34
37
  @api_url = UNSET_VALUE
35
38
  @distributionid = UNSET_VALUE
36
39
  @distribution = UNSET_VALUE
40
+ @stackscriptid = UNSET_VALUE
41
+ @stackscript = UNSET_VALUE
42
+ @stackscript_udf_responses = UNSET_VALUE
37
43
  @imageid = UNSET_VALUE
38
- @image = UNSET_VALUE
39
- @datacenterid = UNSET_VALUE
44
+ @image = UNSET_VALUE
45
+ @datacenterid = UNSET_VALUE
40
46
  @datacenter = UNSET_VALUE
41
47
  @planid = UNSET_VALUE
42
48
  @plan = UNSET_VALUE
@@ -61,13 +67,16 @@ module VagrantPlugins
61
67
  @imageid = nil if @imageid == UNSET_VALUE
62
68
  @image = nil if @image == UNSET_VALUE
63
69
  @distributionid = nil if @distributionid == UNSET_VALUE
64
- @distribution = nil if @distribution == UNSET_VALUE
70
+ @distribution = nil if @distribution == UNSET_VALUE
65
71
  @distribution = 'Ubuntu 14.04 LTS' if @distribution.nil? and @distributionid.nil? and @imageid.nil? and @image.nil?
72
+ @stackscriptid = nil if @stackscriptid == UNSET_VALUE
73
+ @stackscript = nil if @stackscript == UNSET_VALUE
74
+ @stackscript_udf_responses = nil if @stackscript_udf_responses == UNSET_VALUE
66
75
  @datacenterid = nil if @datacenterid == UNSET_VALUE
67
76
  @datacenter = nil if @datacenter == UNSET_VALUE
68
77
  @datacenter = 'dallas' if @datacenter.nil? and @datacenterid.nil?
69
78
  @planid = nil if @planid == UNSET_VALUE
70
- @plan = nil if @plan == UNSET_VALUE
79
+ @plan = nil if @plan == UNSET_VALUE
71
80
  @plan = 'Linode 1024' if @plan.nil? and @planid.nil?
72
81
  @paymentterm = '1' if @paymentterm == UNSET_VALUE
73
82
  @private_networking = false if @private_networking == UNSET_VALUE
@@ -97,29 +106,39 @@ module VagrantPlugins
97
106
  errors << I18n.t('vagrant_linode.config.public_key', key: "#{key}.pub")
98
107
  end
99
108
 
100
- if @distributionid and @distribution
101
- errors << I18n.t('vagrant_linode.config.distributionid_or_distribution')
102
- end
109
+ if @distributionid and @distribution
110
+ errors << I18n.t('vagrant_linode.config.distributionid_or_distribution')
111
+ end
112
+
113
+ <<<<<<< 879127420e478cc36b502abe9dd6d88b7d3ccc40
114
+ if @stackscriptid and @stackscript
115
+ errors << I18n.t('vagrant_linode.config.stackscriptid_or_stackscript')
116
+ end
103
117
 
104
118
  if @datacenterid and @datacenter
105
119
  errors << I18n.t('vagrant_linode.config.datacenterid_or_datacenter')
106
120
  end
121
+ =======
122
+ if @datacenterid and @datacenter
123
+ errors << I18n.t('vagrant_linode.config.datacenterid_or_datacenter')
124
+ end
125
+ >>>>>>> nagging white-space clean-up in config.rb
107
126
 
108
- if @kernelid and @kernel
109
- errors << I18n.t('vagrant_linode.config.kernelid_or_kernel')
110
- end
127
+ if @kernelid and @kernel
128
+ errors << I18n.t('vagrant_linode.config.kernelid_or_kernel')
129
+ end
111
130
 
112
- if @planid and @plan
113
- errors << I18n.t('vagrant_linode.config.planid_or_plan')
114
- end
131
+ if @planid and @plan
132
+ errors << I18n.t('vagrant_linode.config.planid_or_plan')
133
+ end
115
134
 
116
- if @imageid and @image
117
- errors << I18n.t('vagrant_linode.config.imageid_or_image')
118
- end
135
+ if @imageid and @image
136
+ errors << I18n.t('vagrant_linode.config.imageid_or_image')
137
+ end
119
138
 
120
- if (@distribution or @distributionid) and (@imageid or @image)
121
- errors << I18n.t('vagrant_linode.config.distribution_or_image')
122
- end
139
+ if (@distribution or @distributionid) and (@imageid or @image)
140
+ errors << I18n.t('vagrant_linode.config.distribution_or_image')
141
+ end
123
142
 
124
143
  { 'Linode Provider' => errors }
125
144
  end
@@ -56,6 +56,14 @@ module VagrantPlugins
56
56
  class RsyncError < LinodeError
57
57
  error_key(:rsync)
58
58
  end
59
+
60
+ class StackscriptMatch < LinodeError
61
+ error_key(:stackscript_match)
62
+ end
63
+
64
+ class StackscriptUDFFormat < LinodeError
65
+ error_key(:stackscript_udf_responses)
66
+ end
59
67
  end
60
68
  end
61
69
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Linode
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -46,6 +46,7 @@ en:
46
46
  disk_too_large: "Disk Images use more drive space than plan allocates"
47
47
  planid_or_plan: "Use either planid or plan, not both"
48
48
  distributionid_or_distribution: "Use either distributionid or distribution, not both"
49
+ stackscriptid_or_stackscript: "Use either stackscriptid or stackscript, not both"
49
50
  datacenterid_or_datacenter: "Use either datacenterid or datacenter, not both"
50
51
  kernelid_or_kernel: "Use either kernelid or kernel, not both"
51
52
  imageid_or_image: "Use either imageid or image, not both"
@@ -126,3 +127,8 @@ en:
126
127
  plan_id: !-
127
128
  The plan which you have specified ( %{plan} ) is not available at this time,
128
129
  for more information regarding plans review the following url - https://www.linode.com/pricing
130
+ stackscript_match: !-
131
+ The provider does not have your chosen Stackscript ( %{stackscript} ).
132
+ Supported distributions can be found at the following url - https://manager.linode.com/stackscripts
133
+ stackscript_udf_responses: !-
134
+ The stackscript UDF responses object provided is of the wrong type. It should be a Hash.
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.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marques Johansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-06 00:00:00.000000000 Z
12
+ date: 2016-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: linodeapi
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.2.2
206
+ rubygems_version: 2.5.1
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Enables Vagrant to manage Linode linodes