vagrant-rekey-ssh 0.1.0 → 0.1.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,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTkyMzA1ZGQ2YjAwYzI5MDVlYjY0MmZmY2E4Y2FjMjU1NmZiZWMzMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzI0ZTllMWNjZjcwYjJhZmNkNDVhYThiN2Y4Nzg4NzViYjU0YjIxOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWFkODA3MDJjOTNlOTE0NjgyMTFkYjc3YTVlZmM5YWI5YTg0Yjc0NDVjNGY1
|
10
|
+
ZDQ3MDFkMTFiNWNhYzk5NWJjZWU3Nzk5Y2RhMTM0YTBiYzA0YjNlNWE5Yjhh
|
11
|
+
NDc1YjFkNWQyNzJmODhjYzVlMjZkNTMyZGEwMzU4MmY4ZjllM2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDhlZjdkYWRiYzcyNzFiZDlkZDA1MzQxOWVkMjIwNDhlMDE5YjVmMDNjNDU0
|
14
|
+
YjU3YzNiNDU0MTgzN2MxMmZkZmQyNmVkYzY4ZTE4ZDY2NDkyZjhhNDNlZDMy
|
15
|
+
MzA2YzFlOGJhNTFlNGIwYzgyMzMyMWZjY2UxYWVkMWRjNDQxOWY=
|
data/Gemfile
CHANGED
@@ -7,6 +7,6 @@ group :development do
|
|
7
7
|
# We depend on Vagrant for development, but we don't add it as a
|
8
8
|
# gem dependency because we expect to be installed within the
|
9
9
|
# Vagrant environment itself using `vagrant plugin`.
|
10
|
-
gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git"
|
10
|
+
gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :tag => 'v1.3.5'
|
11
11
|
end
|
12
12
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
require "vagrant-rekey-ssh/helpers"
|
3
|
+
require "fileutils"
|
3
4
|
|
4
5
|
module VagrantPlugins
|
5
6
|
module RekeySSH
|
@@ -37,6 +38,9 @@ module VagrantPlugins
|
|
37
38
|
elsif result == 2
|
38
39
|
raise Errors::ErrorReplacingInsecureKey
|
39
40
|
elsif result == 3
|
41
|
+
# store an indicator that the key has been replaced
|
42
|
+
FileUtils.touch(rekey_sentinel_file)
|
43
|
+
|
40
44
|
@machine.ui.info(I18n.t("vagrant_rekey_ssh.info.key_replaced"))
|
41
45
|
|
42
46
|
# if the insecure key *was* there, disable the user's and root's password too
|
@@ -45,6 +49,8 @@ module VagrantPlugins
|
|
45
49
|
# wasn't then perhaps it's a custom box and we shouldn't mess with it
|
46
50
|
@machine.communicate.execute("sudo passwd --delete $USER; sudo passwd --delete root", sudo: false)
|
47
51
|
|
52
|
+
|
53
|
+
|
48
54
|
end
|
49
55
|
|
50
56
|
end
|
@@ -24,8 +24,18 @@ module VagrantPlugins
|
|
24
24
|
# in case we haven't replaced the key yet.
|
25
25
|
# -> TODO: only specify the insecure key when we haven't set the
|
26
26
|
# less insecure key on the box.
|
27
|
+
|
27
28
|
if @machine.config.ssh.private_key_path.nil?
|
28
|
-
|
29
|
+
|
30
|
+
if ::File.exists?(rekey_sentinel_file)
|
31
|
+
@machine.config.ssh.private_key_path = ssh_key_path
|
32
|
+
end
|
33
|
+
|
34
|
+
# Vagrant < 1.4 only supports a single ssh key, do this differently
|
35
|
+
#if Vagrant::VERSION <= "1.4.0"
|
36
|
+
#else
|
37
|
+
# @machine.config.ssh.private_key_path = [ssh_key_path, @machine.env.default_private_key_path]
|
38
|
+
#end
|
29
39
|
end
|
30
40
|
|
31
41
|
end
|