vagrant-g5k 0.0.5 → 0.0.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: 2356c0013be92069f4e7d3bc2987c175e20ff007
4
- data.tar.gz: 2d94e08a93912a7fec591109cdee311614872cb9
3
+ metadata.gz: 86aa6692b587f6dafb5af922cd68f0093ef881dd
4
+ data.tar.gz: 34f959c39976c1a691fff4a56dea00936833f933
5
5
  SHA512:
6
- metadata.gz: 3e3beec21c5dd929985e4d7dd5c97b2bf921ca8a11d16b32e87fd5b54a9bd86859da41cf1d465a927031ed248d67daacdb4aa262ed22a9bc059a77352c9baab7
7
- data.tar.gz: 9e94479cf5412fe688fdb82b196d541aeddfa6ddabd75398ffbbb0a84ef37ceda848bb5ebac4ced24f03a5e4f5e70e91727989b13d25b4f322db235efe02b454
6
+ metadata.gz: e830af79549e92e5eeea46ac5f916614da5f289e4660e5a5889975b97c2ae1f506ee314434834ed8f0e3e35d51165d36072da3ffd88866ee3e6b660429342ff6
7
+ data.tar.gz: 20e48f9704439fbe1b60a20e88244c4e31cf190ae837fa5b9e293848f4b9ad2a185b94af2c4423662a7780bbfe2ced3086c8ca5b7a723e78070fd058ed411d44
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vagrant G5K Provider
2
2
  This is a [Vagrant](http://www.vagrantup.com) 1.2+ plugin that adds an [G5K](https://www.grid5000.fr)
3
- provider to Vagrant, allowing Vagrant to control and provision machines in
3
+ provider to Vagrant, allowing Vagrant to control and provision **virtual machines** in
4
4
  Grid5000.
5
5
 
6
6
  **NOTE:** This plugin requires Vagrant 1.2+,
@@ -25,3 +25,9 @@ $ vagrant up --provider=g5k
25
25
  ## Configuration
26
26
 
27
27
  Check the Vagrantfile.
28
+
29
+ ## Supported operations
30
+
31
+ * `vagrant up`
32
+ * `vagrant ssh`
33
+ * `vagrant destroy`
@@ -12,16 +12,28 @@ module VagrantPlugins
12
12
  end
13
13
 
14
14
  def call(env)
15
- env[:machine_ssh_info] = read_ssh_info(env[:g5k_connection], env[:machine])
15
+ ports = env[:machine].provider_config.ports
16
+ ssh_fwd = ports.select{ |x| x.split(':')[1] == '22'}.first
17
+ if ssh_fwd.nil?
18
+ env[:ui].error "SSH port 22 must be forwarded"
19
+ raise Error "SSh port 22 isn't forwarded"
20
+ end
21
+ ssh_fwd = ssh_fwd.split('-:')[0]
22
+ env[:machine_ssh_info] = read_ssh_info(env[:g5k_connection], env[:machine], ssh_fwd)
16
23
 
17
24
  @app.call(env)
18
25
  end
19
26
 
20
- def read_ssh_info(conn, machine)
27
+ def read_ssh_info(conn, machine, ssh_fwd)
21
28
  return nil if machine.id.nil?
22
29
 
30
+ if ssh_fwd.nil?
31
+
32
+ raise Error "ssh_port should be forwarded"
33
+ end
34
+
23
35
  return { :host => conn.node,
24
- :port => 2222,
36
+ :port => ssh_fwd,
25
37
  :proxy_command => "ssh #{conn.username}@access.grid5000.fr nc %h %p",
26
38
  }
27
39
  end
@@ -141,8 +141,6 @@ module VagrantPlugins
141
141
  end
142
142
 
143
143
  def _generate_net()
144
- # default port to use for ssh
145
- @ports << "2222-:22"
146
144
  fwd_ports = @ports.map do |p|
147
145
  "hostfwd=tcp::#{p}"
148
146
  end.join(',')
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module G5K
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-g5k
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Simonin
@@ -129,7 +129,8 @@ files:
129
129
  - lib/vagrant-g5k.rb
130
130
  - lib/vagrant-g5k/.config.rb.swp
131
131
  - lib/vagrant-g5k/action.rb
132
- - lib/vagrant-g5k/action/.delete_job.rb.swp
132
+ - lib/vagrant-g5k/action/.connect_g5k.rb.swp
133
+ - lib/vagrant-g5k/action/.read_ssh_info.rb.swp
133
134
  - lib/vagrant-g5k/action/connect_g5k.rb
134
135
  - lib/vagrant-g5k/action/create_local_working_dir.rb
135
136
  - lib/vagrant-g5k/action/delete_job.rb