simp-cli 1.0.17 → 1.0.18
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 +4 -4
- data/lib/simp/cli.rb +1 -1
- data/lib/simp/cli/commands/passgen.rb +13 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f73cedf68b3a0ad91e56b00711650ddd2fec1d85
|
|
4
|
+
data.tar.gz: 1cba90ed78d3fe2286c4f71de53cc40fcea9218f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f40381772269c7bda63ea7d9a39c7d2eb6a8fb842ad43ce7cf0cad0c6c40e465da6347b33730ad92285941ef259afc9391cb0c2080ac08e94da42a840ebd0e50
|
|
7
|
+
data.tar.gz: 589d187a88c732ba76b2e671d73b402929b1834308a2d0625097238067a968743a1dcad4a69e8a3a5c30a887d2c55757d3c63f8e54a4550944b20c8fe6797f61
|
data/lib/simp/cli.rb
CHANGED
|
@@ -3,7 +3,6 @@ module Simp::Cli::Commands; end
|
|
|
3
3
|
class Simp::Cli::Commands::Passgen < Simp::Cli
|
|
4
4
|
require 'fileutils'
|
|
5
5
|
|
|
6
|
-
@target_dir = '/etc/puppet/modules/site/files/gen_passwd'
|
|
7
6
|
@show_list = false
|
|
8
7
|
@show_users = Array.new
|
|
9
8
|
@set_users = Array.new
|
|
@@ -41,6 +40,15 @@ class Simp::Cli::Commands::Passgen < Simp::Cli
|
|
|
41
40
|
puts opts
|
|
42
41
|
exit 0
|
|
43
42
|
end
|
|
43
|
+
|
|
44
|
+
unless @target_dir
|
|
45
|
+
env_path = %x(puppet config print environmentpath).strip
|
|
46
|
+
if File.directory?(env_path)
|
|
47
|
+
@target_dir = File.join(env_path, 'simp/simp_autofiles/gen_passwd')
|
|
48
|
+
else
|
|
49
|
+
raise(OptionParser::ParseError, 'Could not find a target passgen directory, please specify one with the `-d` option')
|
|
50
|
+
end
|
|
51
|
+
end
|
|
44
52
|
end
|
|
45
53
|
|
|
46
54
|
def self.run(args = Array.new)
|
|
@@ -51,8 +59,9 @@ class Simp::Cli::Commands::Passgen < Simp::Cli
|
|
|
51
59
|
|
|
52
60
|
begin
|
|
53
61
|
Dir.chdir(@target_dir) do
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
#File.ftype("#{@target_dir}/#{name}").eql?("file")
|
|
63
|
+
@user_names = Dir.glob("*").select do |x|
|
|
64
|
+
File.file?(x) && (x !~ /\..+$/)
|
|
56
65
|
end
|
|
57
66
|
end
|
|
58
67
|
rescue => err
|
|
@@ -75,7 +84,7 @@ class Simp::Cli::Commands::Passgen < Simp::Cli
|
|
|
75
84
|
if File.exists?(last_password_file)
|
|
76
85
|
last_password = File.open(last_password_file, 'r').gets
|
|
77
86
|
end
|
|
78
|
-
puts " Previous: #{
|
|
87
|
+
puts " Previous: #{last_password}" if last_password
|
|
79
88
|
end
|
|
80
89
|
else
|
|
81
90
|
raise "Invalid username '#{user}' selected.\n\n Valid: #{@user_names.join(', ')}"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simp-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Trevor Vaughan
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
autorequire:
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date: 2016-
|
|
16
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: highline
|