vagrant-junos 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f72d17a04c64856719508d00372f21a3c0aab8fa
4
- data.tar.gz: c94681cd514bcdbacecf4d9ede3f64bd673864fa
3
+ metadata.gz: 16a8b9343dcfd9927b32a4c24af87437c4ba52a3
4
+ data.tar.gz: e6daa5c8ee7634d102249d042e9c5a6e3213aee3
5
5
  SHA512:
6
- metadata.gz: 9569b8b166cc1873ee64cb6b237f92fd84f671c61de68f11d7db99cb1f1ce9dee7044f0c1ae0ec17ccd0ce9cea82d5f84e7fb4e3134590dcf188d2f9e2a2a785
7
- data.tar.gz: a7e99c05261a0c9aa12a5ef93c809302722558cac2bc0e53ce8488472a25e90a111e55e23e477434b6e84d6a1a52d2bdd8d2b6843c533537b16ac91f4d293db5
6
+ metadata.gz: 88809822a9710f05a892d1707cde9032263ee8ceee108b194596484502033cc5d82d75710571ce818784e17424a0dc9b99563d156626795c56088039c5f2548a
7
+ data.tar.gz: 91eb44a22182c370a35f4f2c3ec81fe32a44749215e5b9d6314071d007fa5068d0fd9f49d67b98a74646e758767b9364a65bceffc933e365e9c0eb7de5cc9e76
@@ -1 +1 @@
1
- 2.0.0-p576
1
+ 2.1.5
data/Gemfile CHANGED
@@ -11,8 +11,6 @@ end
11
11
 
12
12
  group 'test' do
13
13
  gem 'rake'
14
- gem 'chefspec'
15
- gem 'foodcritic'
16
14
  gem 'rubocop'
17
15
  end
18
16
 
data/README.md CHANGED
@@ -4,20 +4,18 @@
4
4
 
5
5
 
6
6
 
7
- This is a [Vagrant](http://www.vagrantup.com) 1.6+ plugin that adds a Junos guest to Vagrant, allowing for OS detection and initial configuration
7
+ This is a [Vagrant](http://www.vagrantup.com) 1.7+ plugin that adds a Junos guest to Vagrant, allowing for OS detection and initial configuration
8
8
 
9
- > **NOTE:** This plugin requires Vagrant 1.6.3+,
9
+ > **NOTE:** This plugin requires Vagrant 1.7+,
10
10
 
11
11
  ## Features
12
12
 
13
- * Detect [Firefly Perimeter](http://www.juniper.net/us/en/products-services/security/firefly-perimeter/) guest instances automatically, or via [Vagrantfile](https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html). The default boxes on [Juniper's Vagrant Cloud site](https://vagrantcloud.com/Juniper) have `config.vm.guest` explicitly set to Junos.
13
+ * Detect [vSRX](http://www.juniper.net/us/en/products-services/security/srx-series/vsrx/) guest instances automatically, or via [Vagrantfile](https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html). The default boxes on [Juniper's Atlas site](http://atlas.hashicorp.com/Juniper) have `config.vm.guest` explicitly set to Junos.
14
14
  * Set the hostname via [Vagrantfile](https://docs.vagrantup.com/v2/vagrantfile/machine_settings.html) - `config.vm.hostname`
15
- * Change the default SSH key via the [Vagrantfile SSH settings](https://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html) - `config.ssh.private_key_path`
16
- * TBD: network configuration of ge-0/0/0.0 through ge-0/0/9.0
17
- * TBD: mounting of NFS folders for sharing data, if this is valuable to anyone
18
- * TBD: a switch to NETCONF-based configuration, if it adds any functionality
15
+ * Support [Vagrantfile SSH settings](https://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html) - `config.ssh.private_key_path`, etc.
16
+ * Network configuration of ge-0/0/1.0 through ge-0/0/9.0
17
+ * __TBD__: anything you request via [issues](https://github.com/JNPRAutomate/vagrant-junos/issues)
19
18
 
20
- > **NOTE:** post-bootstrap configuration in Vagrant will be carried out through the [vagrant-netconf](https://github.com/JNPRAutomate/vagrant-netconf) communicator plugin and [vagrant-jprovision](https://github.com/JNPRAutomate/vagrant-jprovision) provisioner plugin. These may or may not be required in the premade boxes in the future.
21
19
 
22
20
  ## Usage
23
21
 
@@ -65,3 +63,7 @@ Use bundler to execute Vagrant:
65
63
  ```
66
64
  $ bundle exec vagrant up juniper/ffp-12.1X46-D20.5
67
65
  ```
66
+
67
+ ## Notes
68
+
69
+ > **NOTE:** post-bootstrap configuration in Vagrant will be carried out through the [vagrant-netconf](https://github.com/JNPRAutomate/vagrant-netconf) communicator plugin and [vagrant-jprovision](https://github.com/JNPRAutomate/vagrant-jprovision) provisioner plugin. These may or may not be required in the premade boxes in the future.
@@ -16,7 +16,7 @@ module VagrantPlugins
16
16
  network[:prefix_length] = (network[:netmask] && netmask_to_cidr(network[:netmask]))
17
17
  end
18
18
 
19
- # render template, based on Vagrantfile, and upload
19
+ # render template based on Vagrantfile, and upload
20
20
  network_module = TemplateRenderer.render('guest/junos/network',
21
21
  options: networks,
22
22
  template_root: "#{Dir.home}/.vagrant.d/gems/gems/vagrant-junos-#{VagrantPlugins::GuestJunos::VERSION}/templates")
@@ -38,7 +38,7 @@ module VagrantPlugins
38
38
  def self.deploy(machine)
39
39
  machine.communicate.tap do |comm|
40
40
  comm.execute('cli -f /mfs/tmp/network')
41
- # comm.execute('rm /mfs/tmp/network')
41
+ comm.execute('rm /mfs/tmp/network')
42
42
  end
43
43
  end
44
44
 
@@ -0,0 +1,25 @@
1
+ require 'tempfile'
2
+ require 'vagrant-junos/version'
3
+ require 'vagrant/util/shell_quote'
4
+ require 'vagrant/util/template_renderer'
5
+
6
+ module VagrantPlugins
7
+ module GuestJunos
8
+ module Cap
9
+ # Completely dumb check for now - only one key per user
10
+ class RemovePublicKey
11
+ include Vagrant::Util
12
+
13
+ def self.remove_public_key(machine, contents)
14
+ contents = contents.chomp
15
+ contents = Vagrant::Util::ShellQuote.escape(contents, "'")
16
+
17
+ machine.communicate.tap do |comm|
18
+ comm.test("test -f ~/.ssh/authorized_keys")
19
+ comm.execute("cat #{contents}")
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -6,8 +6,8 @@ end
6
6
 
7
7
  # This is a sanity check to make sure no one is attempting to install
8
8
  # this into an early Vagrant version.
9
- if Vagrant::VERSION < '1.6.0'
10
- fail 'The vagrant-junos plugin is only compatible with Vagrant 1.6+'
9
+ if Vagrant::VERSION < '1.7.0'
10
+ fail 'The vagrant-junos plugin is only compatible with Vagrant 1.7+'
11
11
  end
12
12
 
13
13
  module VagrantPlugins
@@ -44,6 +44,11 @@ module VagrantPlugins
44
44
  require_relative 'cap/insert_public_key'
45
45
  Cap::InsertPublicKey
46
46
  end
47
+
48
+ guest_capability('junos', 'remove_public_key') do
49
+ require_relative 'cap/remove_public_key'
50
+ Cap::RemovePublicKey
51
+ end
47
52
  end
48
53
  end
49
54
  end
@@ -1,6 +1,6 @@
1
1
  module VagrantPlugins
2
2
  # Junos guest gem + plugin version
3
3
  module GuestJunos
4
- VERSION = '0.0.4'
4
+ VERSION = '0.1.0'
5
5
  end
6
6
  end
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency 'bundler', '~> 1.6.6'
22
- spec.add_development_dependency 'rake', '~> 10.0'
21
+ spec.add_development_dependency 'bundler', '~> 1.6.9'
22
+ spec.add_development_dependency 'rake', '~> 10.4.2'
23
23
  spec.add_development_dependency 'rspec-core', '~> 2.14'
24
24
  spec.add_development_dependency 'rspec-expectations', '~> 2.14'
25
25
  spec.add_development_dependency 'rspec-mocks', '~> 2.14'
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-junos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Deatherage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-23 00:00:00.000000000 Z
11
+ date: 2015-03-24 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
- version: 1.6.6
19
+ version: 1.6.9
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.6.6
26
+ version: 1.6.9
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 10.4.2
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 10.4.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.14'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-expectations
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.14'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.14'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-mocks
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.14'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.14'
83
83
  description: A Vagrant plugin for Junos guests, e.g. Firefly Perimeter
@@ -87,10 +87,10 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rubocop.yml
92
- - .ruby-version
93
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".rubocop.yml"
92
+ - ".ruby-version"
93
+ - ".travis.yml"
94
94
  - Gemfile
95
95
  - LICENSE.txt
96
96
  - README.md
@@ -100,6 +100,7 @@ files:
100
100
  - lib/vagrant-junos/cap/configure_networks.rb
101
101
  - lib/vagrant-junos/cap/halt.rb
102
102
  - lib/vagrant-junos/cap/insert_public_key.rb
103
+ - lib/vagrant-junos/cap/remove_public_key.rb
103
104
  - lib/vagrant-junos/guest.rb
104
105
  - lib/vagrant-junos/plugin.rb
105
106
  - lib/vagrant-junos/version.rb
@@ -117,17 +118,17 @@ require_paths:
117
118
  - lib
118
119
  required_ruby_version: !ruby/object:Gem::Requirement
119
120
  requirements:
120
- - - '>='
121
+ - - ">="
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  requirements:
125
- - - '>='
126
+ - - ">="
126
127
  - !ruby/object:Gem::Version
127
128
  version: '0'
128
129
  requirements: []
129
130
  rubyforge_project:
130
- rubygems_version: 2.0.14
131
+ rubygems_version: 2.2.2
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: A Vagrant plugin for Junos guests, e.g. Firefly Perimeter