vagrant-junos_cli 1.0.0 → 1.0.1

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: de8e0cec5ffa6a07787c3ea64d1104fb82319537
4
- data.tar.gz: eb47ce35ad3852cd1cb3a216f1c0bb6e5dc66110
3
+ metadata.gz: d7290a4051b7190108477a6cc4c9ac17579bfccb
4
+ data.tar.gz: 4f65b37b7f98530114626587b485b5f0a2b65ad3
5
5
  SHA512:
6
- metadata.gz: 7dedc9f20b2d49a667e57835deb7bbbf8d262950fab053f8e777634c4bdbf1e9909c7b76519f72474f20443a796afff2185539a7866cf3ec2fc519fc2477798a
7
- data.tar.gz: 9a92b505bec6ce20b7d8f4c61ea08ef6705e910bc01cdc3bed78a10569fb74a9885cf48d8c4fdadd3118bc2aac99c983dd964dc161b740829f2aa1bbb74c672f
6
+ metadata.gz: b7faa8159b988739028958475901d3211bcf44bf0c1bc9ffccc047ded4497de83a86849da6df86283021d1b765fb54ff1cf47f2b2085e3f27e344b491084e1b5
7
+ data.tar.gz: 436510b8b418e016238fbeedf7fc76a67438cb3fcf91b5e4f556da6cf7d998e090ed2816b0c79e7a7b0efeae5bfde36865b7a3e44087239df07505e7d6aef450
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1
4
+
5
+ - Usage of quotes in the provisioning script has been fixed
6
+ - Example and readme have been updated
7
+ - Provisioning with root user has been fixed (vSRX)
8
+
9
+ ## 1.0.0
10
+
11
+ - Initial implementation
12
+
data/README.md CHANGED
@@ -50,7 +50,7 @@ Note the `provision.cmd` file, referenced in the provisioner.
50
50
  This is where your CLI commands should go.
51
51
 
52
52
  ```
53
- configure
53
+ configure private
54
54
  set interfaces em3 unit 0 family inet address 10.0.0.1/24
55
55
  commit
56
56
  exit
@@ -61,5 +61,5 @@ Run `vagrant up` and the new box is getting created with the address configured.
61
61
  ## Configuration
62
62
 
63
63
  Junos CLI provisioner accepts most parameters available for the [Shell provisioner](https://www.vagrantup.com/docs/provisioning/shell.html).
64
- Do not pass `args`.
64
+ Do not pass `args` or `env`.
65
65
 
@@ -1,4 +1,4 @@
1
- configure
1
+ configure private
2
2
  set interfaces em3 unit 0 family inet address 10.0.0.1/24
3
3
  show | compare
4
4
  commit
@@ -13,7 +13,7 @@ module Vagrant
13
13
  protected
14
14
 
15
15
  def provision_junos_cli
16
- @machine.config.ssh.shell = 'start shell'
16
+ @machine.config.ssh.shell = 'start shell' unless @machine.config.ssh.username == 'root'
17
17
 
18
18
  with_script_file do |path|
19
19
  @machine.communicate.tap do |comm|
@@ -24,6 +24,12 @@ module Vagrant
24
24
  raise Vagrant::Errors::SSHNotReady if info.nil?
25
25
  end
26
26
 
27
+ user = info[:username]
28
+ comm.sudo("chown -R #{user} #{config.upload_path}",
29
+ error_check: false)
30
+
31
+ comm.upload(path.to_s, config.upload_path)
32
+
27
33
  if config.name
28
34
  @machine.ui.detail(I18n.t('vagrant.provisioners.shell.running',
29
35
  script: "script: #{config.name}"))
@@ -41,12 +47,13 @@ if [ ! -d ~/.vagrant-junos_cli/bin ]; then\
41
47
  /bin/ln -s /bin/echo ~/.vagrant-junos_cli/bin/printf;\
42
48
  /bin/ln -s /bin/echo ~/.vagrant-junos_cli/bin/export;\
43
49
  /bin/echo setenv PATH \\~/.vagrant-junos_cli/bin:\\$PATH >> ~/.cshrc;\
44
- source ~/.cshrc;\
45
50
  fi'"
46
51
 
47
- cli_oneliner = format('/usr/sbin/cli -c "%s"', File.read(path).tr("\n", ';').gsub(/;+/, ';'))
52
+ cli_oneliner = "/usr/sbin/cli -f #{config.upload_path}"
53
+
54
+ clean_up = "/bin/rm #{config.upload_path}"
48
55
 
49
- [prepare, cli_oneliner].each do |command|
56
+ [prepare, cli_oneliner, clean_up].each do |command|
50
57
  comm.execute(
51
58
  command,
52
59
  sudo: false,
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module JunosCli
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-junos_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mate Farkas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-11 00:00:00.000000000 Z
11
+ date: 2018-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,6 +47,7 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
49
  - ".rubocop.yml"
50
+ - CHANGELOG.md
50
51
  - Gemfile
51
52
  - README.md
52
53
  - Rakefile