vagrant-vyos 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +3 -2
- data/lib/vagrant-vyos/cap/insert_public_key.rb +35 -0
- data/lib/vagrant-vyos/cap/remove_public_key.rb +35 -0
- data/lib/vagrant-vyos/plugin.rb +10 -0
- data/lib/vagrant-vyos/version.rb +1 -1
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZTYxZGIxMWVlMjQwMGJlYThmZDAwZTNmNDVhZTBmYTkzYzQxZjMzZQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0ec20c7345a53d7c0d64239cd907ee06486a9c38
|
4
|
+
data.tar.gz: 1a3788b74897f5bce5656f576911ca0d262ad365
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
MjMwMzhlZDUxY2VkMjQ2ODAyZjI5OTU2Y2YxMWE1MzkxMzI5MWIwMWFhMDkx
|
11
|
-
M2UyNDc5NjcwNzE3ZDI4MTVjOTc3MDY1OTU2NTNiZTJkMzk3OTU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTM4MmJlZDUxYWU1NWYwYWI4ZDBhYzk2OTE4ZGQ0YWQwMGM4NmUwMTI4ZjU5
|
14
|
-
ZDFkY2JlMDcwZTBkZjZlNWRmZjA1N2JmOWYwNTg4YjMwNmM4NzFiZjBlNWEz
|
15
|
-
YzQ4YmZjOWVkMTM4YmZjN2JiY2M0ZjZlZDZkOGJhODZhNzhlYTQ=
|
6
|
+
metadata.gz: 65ac78573b8fb8674423181232b229c0b7647b4bf2d53f5bb8b81017d4a4d3b6230b31470ed8cff5d1e9158d9458997e9eed45351bde6180e6cebf96ff26de56
|
7
|
+
data.tar.gz: 18767b486113c17e5bb391485bfe7de3068fb2154b7cde76d8351b572b4feac4bf558c03a9e88a80ca04b191be9641b5fb6b5cb3bbd6e141144b4f92b4fb1bf3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# vagrant-vyos
|
2
2
|
[![Build Status](https://travis-ci.org/higebu/vagrant-vyos.png)](https://travis-ci.org/higebu/vagrant-vyos)
|
3
|
-
[![Code Climate](https://codeclimate.com/
|
3
|
+
[![Code Climate](https://codeclimate.com/github/higebu/vagrant-vyos/badges/gpa.svg)](https://codeclimate.com/github/higebu/vagrant-vyos)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/vagrant-vyos.png)](http://badge.fury.io/rb/vagrant-vyos)
|
5
5
|
[![Dependency Status](https://gemnasium.com/higebu/vagrant-vyos.png)](https://gemnasium.com/higebu/vagrant-vyos)
|
6
6
|
|
@@ -11,6 +11,7 @@ This plugin fixes following features.
|
|
11
11
|
* `vagrant halt`.
|
12
12
|
* `config.vm.hostname`.
|
13
13
|
* `config.vm.network`.
|
14
|
+
* `config.ssh.insert_key`.
|
14
15
|
|
15
16
|
## Installation
|
16
17
|
|
@@ -21,7 +22,7 @@ $ vagrant plugin install vagrant-vyos
|
|
21
22
|
## Usage
|
22
23
|
|
23
24
|
```
|
24
|
-
$ vagrant init higebu/vyos-1.1.4
|
25
|
+
$ vagrant init higebu/vyos-1.1.4-amd64
|
25
26
|
$ vagrant up
|
26
27
|
```
|
27
28
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module GuestVyOS
|
3
|
+
module Cap
|
4
|
+
class InsertPublicKey
|
5
|
+
def self.insert_public_key(machine, contents)
|
6
|
+
contents = contents.chomp
|
7
|
+
|
8
|
+
key_type, key_value, key_name = contents.split()
|
9
|
+
|
10
|
+
commands = <<-EOS
|
11
|
+
source /opt/vyatta/etc/functions/script-template
|
12
|
+
set system login user vagrant authentication public-keys #{key_name} type #{key_type}
|
13
|
+
set system login user vagrant authentication public-keys #{key_name} key #{key_value}
|
14
|
+
commit
|
15
|
+
save
|
16
|
+
EOS
|
17
|
+
|
18
|
+
temp = Tempfile.new("vagrant")
|
19
|
+
temp.binmode
|
20
|
+
temp.write(commands)
|
21
|
+
temp.close
|
22
|
+
|
23
|
+
machine.communicate.tap do |comm|
|
24
|
+
comm.upload(temp.path, "/tmp/vagrant-insert-public-key")
|
25
|
+
comm.execute("bash /tmp/vagrant-insert-public-key")
|
26
|
+
comm.execute("rm -f /tmp/vagrant-insert-public-key")
|
27
|
+
end
|
28
|
+
|
29
|
+
temp.unlink
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module GuestVyOS
|
3
|
+
module Cap
|
4
|
+
class RemovePublicKey
|
5
|
+
def self.remove_public_key(machine, contents)
|
6
|
+
contents = contents.chomp
|
7
|
+
|
8
|
+
key_type, key_value, key_name = contents.split()
|
9
|
+
|
10
|
+
commands = <<-EOS
|
11
|
+
source /opt/vyatta/etc/functions/script-template
|
12
|
+
show system login user vagrant authentication public-keys #{key_name} key | grep #{key_value} || exit 0
|
13
|
+
delete system login user vagrant authentication public-keys #{key_name}
|
14
|
+
commit
|
15
|
+
save
|
16
|
+
EOS
|
17
|
+
|
18
|
+
temp = Tempfile.new("vagrant")
|
19
|
+
temp.binmode
|
20
|
+
temp.write(commands)
|
21
|
+
temp.close
|
22
|
+
|
23
|
+
machine.communicate.tap do |comm|
|
24
|
+
comm.upload(temp.path, "/tmp/vagrant-remove-public-key")
|
25
|
+
comm.execute("bash /tmp/vagrant-remove-public-key")
|
26
|
+
comm.execute("rm -f /tmp/vagrant-remove-public-key")
|
27
|
+
end
|
28
|
+
|
29
|
+
temp.unlink
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/vagrant-vyos/plugin.rb
CHANGED
@@ -25,6 +25,16 @@ module VagrantPlugins
|
|
25
25
|
require_relative "cap/change_host_name"
|
26
26
|
Cap::ChangeHostName
|
27
27
|
end
|
28
|
+
|
29
|
+
guest_capability("vyos", "insert_public_key") do
|
30
|
+
require_relative "cap/insert_public_key"
|
31
|
+
Cap::InsertPublicKey
|
32
|
+
end
|
33
|
+
|
34
|
+
guest_capability("vyos", "remove_public_key") do
|
35
|
+
require_relative "cap/remove_public_key"
|
36
|
+
Cap::RemovePublicKey
|
37
|
+
end
|
28
38
|
end
|
29
39
|
end
|
30
40
|
end
|
data/lib/vagrant-vyos/version.rb
CHANGED
metadata
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vyos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KUSAKABE Yuya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.5.2
|
20
|
-
- - <
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.8.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.5.2
|
30
|
-
- - <
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.8.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
description: VyOS Guest Support for Vagrant
|
@@ -51,8 +51,8 @@ executables: []
|
|
51
51
|
extensions: []
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
|
-
- .gitignore
|
55
|
-
- .travis.yml
|
54
|
+
- ".gitignore"
|
55
|
+
- ".travis.yml"
|
56
56
|
- Gemfile
|
57
57
|
- LICENSE
|
58
58
|
- README.md
|
@@ -61,6 +61,8 @@ files:
|
|
61
61
|
- lib/vagrant-vyos/cap/change_host_name.rb
|
62
62
|
- lib/vagrant-vyos/cap/configure_networks.rb
|
63
63
|
- lib/vagrant-vyos/cap/halt.rb
|
64
|
+
- lib/vagrant-vyos/cap/insert_public_key.rb
|
65
|
+
- lib/vagrant-vyos/cap/remove_public_key.rb
|
64
66
|
- lib/vagrant-vyos/guest.rb
|
65
67
|
- lib/vagrant-vyos/plugin.rb
|
66
68
|
- lib/vagrant-vyos/version.rb
|
@@ -75,17 +77,17 @@ require_paths:
|
|
75
77
|
- lib
|
76
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
77
79
|
requirements:
|
78
|
-
- -
|
80
|
+
- - ">="
|
79
81
|
- !ruby/object:Gem::Version
|
80
82
|
version: 2.0.0
|
81
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
84
|
requirements:
|
83
|
-
- -
|
85
|
+
- - ">="
|
84
86
|
- !ruby/object:Gem::Version
|
85
87
|
version: 1.3.6
|
86
88
|
requirements: []
|
87
89
|
rubyforge_project: vagrant-vyos
|
88
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.2.5
|
89
91
|
signing_key:
|
90
92
|
specification_version: 4
|
91
93
|
summary: A small gem that adds vyos guest support to vagrant.
|