dust-deploy 0.7.4 → 0.7.5
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.
- data/bin/dust +2 -3
- data/changelog.md +7 -0
- data/lib/dust/print_status.rb +4 -4
- data/lib/dust/recipes/hash_check.rb +1 -2
- data/lib/dust/recipes/iptables.rb +1 -1
- data/lib/dust/recipes/rc_local.rb +2 -0
- data/lib/dust/recipes/ssh_authorized_keys.rb +3 -3
- data/lib/dust/recipes/sudoers.rb +1 -1
- data/lib/dust/version.rb +1 -1
- metadata +3 -3
data/bin/dust
CHANGED
@@ -77,9 +77,7 @@ module Dust
|
|
77
77
|
# connect to server
|
78
78
|
server = Server.new node
|
79
79
|
next unless server.connect
|
80
|
-
|
81
|
-
puts "#{Dust.grey}#{ret[:stdout]}#{Dust.none}"
|
82
|
-
puts "#{Dust.red}#{ret[:stderr]}#{Dust.none}"
|
80
|
+
server.exec cmd, :live => true
|
83
81
|
server.disconnect
|
84
82
|
end
|
85
83
|
end
|
@@ -210,6 +208,7 @@ module Dust
|
|
210
208
|
|
211
209
|
# if more than one hostname is specified, create a node
|
212
210
|
# with the same settings for each hostname
|
211
|
+
node['hostname'] = [ node['hostname'] ] unless node['hostname'].is_a? Enumerable
|
213
212
|
node['hostname'].each do |hostname|
|
214
213
|
n = node.clone
|
215
214
|
|
data/changelog.md
CHANGED
data/lib/dust/print_status.rb
CHANGED
@@ -25,25 +25,25 @@ module Dust
|
|
25
25
|
def self.print_ok string='', options={:quiet => false, :indent => 1}
|
26
26
|
opts = options.clone
|
27
27
|
opts[:indent] = 0 if string.empty?
|
28
|
-
print_msg "#{string} #{blue}[ ok
|
28
|
+
print_msg "#{string} #{blue}[ ok ]#{none}\n", opts
|
29
29
|
true
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.print_failed string='', options={:quiet => false, :indent => 1}
|
33
33
|
opts = options.clone
|
34
34
|
opts[:indent] = 0 if string.empty?
|
35
|
-
print_msg "#{string} #{red}[ failed
|
35
|
+
print_msg "#{string} #{red}[ failed ]#{none}\n", opts
|
36
36
|
false
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.print_warning string='', options={:quiet => false, :indent => 1}
|
40
40
|
opts = options.clone
|
41
41
|
opts[:indent] = 0 if string.empty?
|
42
|
-
print_msg "#{string} #{yellow}[ warning
|
42
|
+
print_msg "#{string} #{yellow}[ warning ]#{none}\n", opts
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.print_hostname hostname, options={:quiet => false, :indent => 0}
|
46
|
-
print_msg "\n[ #{blue}#{hostname}#{none}
|
46
|
+
print_msg "\n[ #{blue}#{hostname}#{none} ]\n\n", options
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.print_recipe recipe, options={:quiet => false, :indent => 0}
|
@@ -11,8 +11,7 @@ class HashCheck < Recipe
|
|
11
11
|
::Dust.print_msg "checking for weak password hashes\n"
|
12
12
|
|
13
13
|
found_weak = false
|
14
|
-
|
15
|
-
shadow.each do |line|
|
14
|
+
shadow.each_line do |line|
|
16
15
|
user, hash = line.split(':')[0..1]
|
17
16
|
next if keys.include? hash
|
18
17
|
method, salt = hash.split('$')[1..2]
|
@@ -255,7 +255,7 @@ class Iptables < Recipe
|
|
255
255
|
|
256
256
|
# prepend iptables command on non-centos-like machines
|
257
257
|
def prepend_cmd
|
258
|
-
@script
|
258
|
+
@script.gsub! /^/, "#{cmd} " unless @node.uses_rpm?
|
259
259
|
end
|
260
260
|
|
261
261
|
# apply newly pushed rules
|
@@ -40,14 +40,14 @@ class SshAuthorizedKeys < Recipe
|
|
40
40
|
# creating user if not existent
|
41
41
|
def deploy_authorized_keys user, authorized_keys
|
42
42
|
# create user, if not existent
|
43
|
-
|
43
|
+
return unless @node.create_user user
|
44
44
|
|
45
45
|
home = @node.get_home user
|
46
46
|
# check and create necessary directories
|
47
|
-
|
47
|
+
return unless @node.mkdir("#{home}/.ssh")
|
48
48
|
|
49
49
|
# deploy authorized_keys
|
50
|
-
|
50
|
+
return unless @node.write "#{home}/.ssh/authorized_keys", authorized_keys
|
51
51
|
|
52
52
|
# check permissions
|
53
53
|
@node.chown "#{user}:#{user}", "#{home}/.ssh"
|
data/lib/dust/recipes/sudoers.rb
CHANGED
@@ -12,7 +12,7 @@ class Sudoers < Recipe
|
|
12
12
|
if rule.is_a? String
|
13
13
|
file = "#{rule}\n"
|
14
14
|
|
15
|
-
# rulename: { user: [ user1, user2
|
15
|
+
# rulename: { user: [ user1, user2 ], command: [ cmd1, cmd2 ] }
|
16
16
|
else
|
17
17
|
unless rule['user'] and rule['command']
|
18
18
|
::Dust.print_failed 'user or command missing', :indent => 2
|
data/lib/dust/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 0.7.
|
8
|
+
- 5
|
9
|
+
version: 0.7.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- kris kechagia
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-02-
|
17
|
+
date: 2012-02-20 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|