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 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
- ret = server.exec cmd
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
@@ -1,6 +1,13 @@
1
1
  Changelog
2
2
  =============
3
3
 
4
+ 0.7.5
5
+ ------------
6
+
7
+ - dust is now compatible with ruby 1.9 again
8
+ - 'dust exec' now displays stdout/stderr live
9
+
10
+
4
11
  0.7.4
5
12
  ------------
6
13
 
@@ -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 ]#{none}\n", opts
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 ]#{none}\n", opts
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 ]#{none}\n", opts
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} ]\n\n", options
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 = @script.map { |s| "#{cmd} #{s}" }.to_s unless @node.uses_rpm?
258
+ @script.gsub! /^/, "#{cmd} " unless @node.uses_rpm?
259
259
  end
260
260
 
261
261
  # apply newly pushed rules
@@ -6,6 +6,8 @@ class RcLocal < Recipe
6
6
  ::Dust.print_msg "configuring custom startup script\n"
7
7
 
8
8
  rc = ''
9
+ @config = [ @config ] unless @config.is_a? Enumerable
10
+
9
11
  @config.each do |cmd|
10
12
  ::Dust.print_msg "adding command: #{cmd}", :indent => 2
11
13
  rc += "#{cmd}\n"
@@ -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
- next unless @node.create_user user
43
+ return unless @node.create_user user
44
44
 
45
45
  home = @node.get_home user
46
46
  # check and create necessary directories
47
- next unless @node.mkdir("#{home}/.ssh")
47
+ return unless @node.mkdir("#{home}/.ssh")
48
48
 
49
49
  # deploy authorized_keys
50
- next unless @node.write "#{home}/.ssh/authorized_keys", authorized_keys
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"
@@ -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 ], command: [ cmd1, cmd2 ] }
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
@@ -1,3 +1,3 @@
1
1
  module Dust
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 4
9
- version: 0.7.4
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 00:00:00 +01:00
17
+ date: 2012-02-20 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency