vagrant-linode 0.2.0 → 0.2.1

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: 2c0b56e45b965f16f865dbd480b823f1c568eca1
4
- data.tar.gz: cb62e7ce8e9482621d273e3f28e9b76678b2c365
3
+ metadata.gz: e16e4d4758bf63cfd92415d81520f83db8f353c3
4
+ data.tar.gz: 6bc13afd6403044f06b2b8cb1d1e2be04d5d2e56
5
5
  SHA512:
6
- metadata.gz: ac6a357b79d595d347ecf7a022f220b38ea9b4e9a5f9fadf219fa31a959c7899b33c6e0c8b06c988345dbefad8247ae6ac6f3ec15f9d2f68ad556421a0360001
7
- data.tar.gz: 69ef3bddf8194c4369d533e7c05ae74feaa207f251f4390e108933bafd6100831b357253c420834e542a023cd0a4964fb5b34402590fe76338a129a5f25c7dc5
6
+ metadata.gz: 4b996b315d58e433ae27434d50b2e8974f15a6fe751ad5f8e6598774673c042ef76aac85b9392e530134d5917a2006e86c76b0a5afe35656c1a5a98217538fd0
7
+ data.tar.gz: d7a18739c9a870e5f4e5affa6c1b1be7da1b67cc819768d4e82f9546ca4c7c20a2f2679c5f027916fa33a5e22651e7484523f140c3ae6e5da32e9fa7d9955e95
data/README.md CHANGED
@@ -19,26 +19,10 @@ Debian 7.5+ guest operating systems.
19
19
 
20
20
  Install
21
21
  -------
22
- Installation of the provider requires two steps:
23
-
24
- 1. Install the provider plugin using the Vagrant command-line interface:
25
-
26
- $ vagrant plugin install vagrant-linode
27
-
28
-
29
- **NOTE:** If you are using a Mac, and this plugin would not work caused by SSL certificate problem,
30
- You may need to specify certificate path explicitly.
31
- You can verify actual certificate path by running:
32
-
33
- ```bash
34
- ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_FILE"
35
- ```
36
-
37
- Then, add the following environment variable to your
38
- `.bash_profile` script and `source` it:
22
+ Installation of the provider couldn't be easier:
39
23
 
40
24
  ```bash
41
- export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem
25
+ vagrant plugin install vagrant-linode
42
26
  ```
43
27
 
44
28
  Configure
@@ -208,7 +192,7 @@ The provider supports the following Vagrant sub-commands:
208
192
  account.
209
193
  - `vagrant halt` - Powers off the linode instance.
210
194
  - `vagrant provision` - Runs the configured provisioners and rsyncs any
211
- specified `config.vm.synced_folder`.
195
+ specified `config.vm.synced_folder`. (see https://docs.vagrantup.com/v2/synced-folders/rsync.html)
212
196
  - `vagrant reload` - Reboots the linode instance.
213
197
  - `vagrant rebuild` - Destroys the linode instance and recreates it with the
214
198
  same IP address which was previously assigned.
@@ -94,7 +94,7 @@ module VagrantPlugins
94
94
  else
95
95
  b2.use Provision
96
96
  b2.use ModifyProvisionPath
97
- b2.use SyncFolders
97
+ b2.use SyncedFolders
98
98
  end
99
99
  end
100
100
  else
@@ -244,6 +244,14 @@ module VagrantPlugins
244
244
  end
245
245
  end
246
246
 
247
+ def self.action_list_kernels
248
+ Vagrant::Action::Builder.new.tap do |b|
249
+ # b.use ConfigValidate # is this per machine?
250
+ b.use ConnectLinode
251
+ b.use ListKernels
252
+ end
253
+ end
254
+
247
255
  action_root = Pathname.new(File.expand_path('../actions', __FILE__))
248
256
  autoload :ConnectLinode, action_root.join('connect_linode')
249
257
  autoload :ReadState, action_root.join('read_state')
@@ -265,12 +273,12 @@ module VagrantPlugins
265
273
  autoload :SetupUser, action_root.join('setup_user')
266
274
  autoload :SetupSudo, action_root.join('setup_sudo')
267
275
  autoload :ReadSSHInfo, action_root.join("read_ssh_info")
268
- autoload :SyncFolders, action_root.join('sync_folders')
269
276
  autoload :ListServers, action_root.join('list_servers')
270
277
  autoload :CreateImage, action_root.join('create_image')
271
278
  autoload :ListImages, action_root.join('list_images')
272
279
  autoload :ListPlans, action_root.join('list_plans')
273
280
  autoload :ListDistributions, action_root.join('list_distributions')
281
+ autoload :ListKernels, action_root.join('list_kernels')
274
282
  autoload :ListDatacenters, action_root.join('list_datacenters')
275
283
  end
276
284
  end
@@ -0,0 +1,20 @@
1
+ module VagrantPlugins
2
+ module Linode
3
+ module Actions
4
+ class ListKernels
5
+ def initialize(app, _env)
6
+ @app = app
7
+ end
8
+
9
+ def call(env)
10
+ linode_api = env[:linode_api]
11
+ env[:ui].info ('%-4s %-6s %-6s %s' % ['ID', 'IsXen', 'IsKVM', 'Kernel Name'])
12
+ linode_api.avail.kernels.sort_by(&:kernelid).each do |kernel|
13
+ env[:ui].info ('%-4s %-6s %-6s %s' % [kernel.kernelid, kernel.isxen, kernel.iskvm, kernel.label])
14
+ end
15
+ @app.call(env)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ module VagrantPlugins
2
+ module Linode
3
+ module Commands
4
+ class Kernels < Vagrant.plugin('2', :command)
5
+ def execute
6
+ options = {}
7
+ opts = OptionParser.new do |o|
8
+ o.banner = 'Usage: vagrant linode kernels [options]'
9
+ end
10
+
11
+ argv = parse_options(opts)
12
+ return unless argv
13
+
14
+ with_target_vms(argv, provider: :linode) do |machine|
15
+ machine.action('list_kernels')
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -24,6 +24,10 @@ module VagrantPlugins
24
24
  require File.expand_path('../distributions', __FILE__)
25
25
  Distributions
26
26
  end
27
+ @subcommands.register(:kernels) do
28
+ require File.expand_path('../kernels', __FILE__)
29
+ Kernels
30
+ end
27
31
  @subcommands.register(:datacenters) do
28
32
  require File.expand_path('../datacenters', __FILE__)
29
33
  Datacenters
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Linode
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -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', '~> 0.1.1'
16
+ gem.add_runtime_dependency 'linodeapi', '~> 0.2.2'
17
17
  gem.add_runtime_dependency 'json', '~> 1.8.3'
18
18
  gem.add_runtime_dependency 'log4r', '~> 1.1.10'
19
19
 
20
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'
21
+ gem.add_development_dependency 'rspec', '~> 3.3.0'
22
+ gem.add_development_dependency 'aruba', '~> 0.9.0'
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marques Johansson
@@ -9,92 +9,92 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-14 00:00:00.000000000 Z
12
+ date: 2015-10-22 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.1.1
20
+ version: 0.2.2
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.1.1
27
+ version: 0.2.2
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: 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
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
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
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
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
69
  version: 10.4.2
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ~>
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 2.14.0
76
+ version: 3.3.0
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ~>
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: 2.14.0
83
+ version: 3.3.0
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: aruba
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ~>
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.5.4
90
+ version: 0.9.0
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ~>
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.5.4
97
+ version: 0.9.0
98
98
  description: Enables Vagrant to manage Linode linodes
99
99
  email:
100
100
  - marques@linode.com
@@ -103,16 +103,15 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - .gitignore
107
- - .rspec
108
- - .rubocop.yml
109
- - .rubocop_todo.yml
106
+ - ".gitignore"
107
+ - ".rspec"
108
+ - ".rubocop.yml"
109
+ - ".rubocop_todo.yml"
110
110
  - CHANGELOG.md
111
111
  - Gemfile
112
112
  - LICENSE.txt
113
113
  - README.md
114
114
  - Rakefile
115
- - Vagrantfile.multi
116
115
  - box/README.md
117
116
  - box/linode-debian-7.5.box
118
117
  - box/linode.box
@@ -136,6 +135,7 @@ files:
136
135
  - lib/vagrant-linode/actions/list_datacenters.rb
137
136
  - lib/vagrant-linode/actions/list_distributions.rb
138
137
  - lib/vagrant-linode/actions/list_images.rb
138
+ - lib/vagrant-linode/actions/list_kernels.rb
139
139
  - lib/vagrant-linode/actions/list_plans.rb
140
140
  - lib/vagrant-linode/actions/list_servers.rb
141
141
  - lib/vagrant-linode/actions/message_already_active.rb
@@ -152,11 +152,11 @@ files:
152
152
  - lib/vagrant-linode/actions/setup_hostname.rb
153
153
  - lib/vagrant-linode/actions/setup_sudo.rb
154
154
  - lib/vagrant-linode/actions/setup_user.rb
155
- - lib/vagrant-linode/actions/sync_folders.rb
156
155
  - lib/vagrant-linode/commands/create_image.rb
157
156
  - lib/vagrant-linode/commands/datacenters.rb
158
157
  - lib/vagrant-linode/commands/distributions.rb
159
158
  - lib/vagrant-linode/commands/images.rb
159
+ - lib/vagrant-linode/commands/kernels.rb
160
160
  - lib/vagrant-linode/commands/list_images.rb
161
161
  - lib/vagrant-linode/commands/networks.rb
162
162
  - lib/vagrant-linode/commands/plans.rb
@@ -193,17 +193,17 @@ require_paths:
193
193
  - lib
194
194
  required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - '>='
196
+ - - ">="
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - '>='
201
+ - - ">="
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.0.14
206
+ rubygems_version: 2.2.2
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Enables Vagrant to manage Linode linodes
data/Vagrantfile.multi DELETED
@@ -1,18 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
- VAGRANTFILE_API_VERSION = "2"
6
-
7
- DATACENTERS = [:newark, :dallas, :atlanta]
8
- Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
9
- Vagrant.require_plugin "vagrant-linode"
10
-
11
- DATACENTERS.each do |datacenter|
12
- config.vm.define datacenter do |machine|
13
- machine.vm.provider :linode do |provider|
14
- provider.api_key = ENV['LINODE_API_KEY']
15
- end
16
- end
17
- end
18
- end
@@ -1,80 +0,0 @@
1
- require 'vagrant/util/subprocess'
2
- require 'vagrant/util/which'
3
-
4
- module VagrantPlugins
5
- module Linode
6
- module Actions
7
- class SyncFolders
8
- def initialize(app, env)
9
- @app = app
10
- @machine = env[:machine]
11
- @logger = Log4r::Logger.new('vagrant::linode::sync_folders')
12
- end
13
-
14
- def call(env)
15
- ssh_info = @machine.ssh_info
16
-
17
- @machine.config.vm.synced_folders.each do |_id, data|
18
- next if data[:disabled]
19
-
20
- if @machine.guest.capability?(:rsync_installed)
21
- installed = @machine.guest.capability(:rsync_installed)
22
- unless installed
23
- can_install = @machine.guest.capability?(:rsync_install)
24
- fail Vagrant::Errors::RSyncNotInstalledInGuest unless can_install
25
- @machine.ui.info I18n.t('vagrant.rsync_installing')
26
- @machine.guest.capability(:rsync_install)
27
- end
28
- end
29
-
30
- hostpath = File.expand_path(data[:hostpath], env[:root_path])
31
- guestpath = data[:guestpath]
32
-
33
- # make sure there is a trailing slash on the host path to
34
- # avoid creating an additional directory with rsync
35
- hostpath = "#{hostpath}/" if hostpath !~ /\/$/
36
-
37
- # on windows rsync.exe requires cygdrive-style paths
38
- if Vagrant::Util::Platform.windows?
39
- hostpath = hostpath.gsub(/^(\w):/) { "/cygdrive/#{Regexp.last_match[1]}" }
40
- end
41
-
42
- env[:ui].info I18n.t('vagrant_linode.info.rsyncing', hostpath: hostpath,
43
- guestpath: guestpath)
44
-
45
- # create the guest path
46
- @machine.communicate.sudo("mkdir -p #{guestpath}")
47
- @machine.communicate.sudo(
48
- "chown -R #{ssh_info[:username]} #{guestpath}")
49
-
50
- key = ssh_info[:private_key_path]
51
- key = key[0] if key.is_a?(Array)
52
-
53
- # rsync over to the guest path using the ssh info
54
- command = [
55
- 'rsync', '--verbose', '--archive', '-z', '--delete',
56
- '-e', "ssh -p #{ssh_info[:port]} -o StrictHostKeyChecking=no -i '#{key}'",
57
- hostpath,
58
- "#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
59
-
60
- # we need to fix permissions when using rsync.exe on windows, see
61
- # http://stackoverflow.com/questions/5798807/rsync-permission-denied-created-directories-have-no-permissions
62
- if Vagrant::Util::Platform.windows?
63
- command.insert(1, '--chmod', 'ugo=rwX')
64
- end
65
-
66
- r = Vagrant::Util::Subprocess.execute(*command)
67
- if r.exit_code != 0
68
- fail Errors::RsyncError,
69
- guestpath: guestpath,
70
- hostpath: hostpath,
71
- stderr: r.stderr
72
- end
73
- end
74
-
75
- @app.call(env)
76
- end
77
- end
78
- end
79
- end
80
- end