dust-deploy 0.13.11 → 0.13.12

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/changelog.md CHANGED
@@ -1,6 +1,20 @@
1
1
  Changelog
2
2
  =============
3
3
 
4
+ 0.13.12
5
+ ------------
6
+
7
+ - nginx recipe displays error message when configtest fails
8
+ - nginx recipe supports specifying package to install
9
+ - nginx recipe now uses binding for deploying nginx.conf (so you can call node.functions)
10
+
11
+ recipes:
12
+ nginx:
13
+ package: nginx-extras
14
+ sites:
15
+ enabled: reverse-proxy
16
+
17
+
4
18
  0.13.11
5
19
  ------------
6
20
 
@@ -30,6 +30,9 @@ class Duplicity < Recipe
30
30
  # check whether we need ncftp
31
31
  @node.install_package 'ncftp' if config['backend'].include? 'ftp://'
32
32
 
33
+ # scp backend on centos needs python-paramiko
34
+ @node.install_package 'python-paramiko' if @node.uses_rpm? and config['backend'].include? 'scp://'
35
+
33
36
  # scp backend on centos needs python-pexpect (not needed anymore for newer systems)
34
37
  # @node.install_package 'python-pexpect' if config['backend'].include? 'scp://' and @node.uses_rpm?
35
38
 
@@ -49,6 +49,7 @@ class Iptables < Recipe
49
49
  # install iptables
50
50
  def install
51
51
  return false unless @node.install_package 'iptables'
52
+ return false unless @node.install_package 'ip6tables' if @node.uses_opkg?
52
53
  return false unless @node.install_package 'iptables-persistent' if @node.uses_apt?
53
54
  return false unless @node.install_package 'iptables-ipv6' if @node.uses_rpm? and not @node.is_fedora?
54
55
  true
@@ -285,6 +286,12 @@ class Iptables < Recipe
285
286
  @node.autostart_service('iptables-persistent') if @node.uses_apt?
286
287
  end
287
288
 
289
+ # disable firewall hotplug scripts on openwrt
290
+ if @node.uses_opkg?
291
+ msg = @node.messages.add('disabling firewall hotplug scripts in /etc/hotplug.d/firewall')
292
+ msg.parse_result(@node.exec('chmod -x /etc/hotplug.d/firewall/*')[:exit_code])
293
+ end
294
+
288
295
  @node.write(target, @script, :quiet => true)
289
296
  @node.chmod('0600', target)
290
297
  end
@@ -1,22 +1,25 @@
1
1
  class Nginx < Recipe
2
2
  desc 'nginx:deploy', 'installs and configures nginx web server'
3
3
  def deploy
4
+ # default package to install
5
+ @config['package'] ||= 'nginx'
6
+
4
7
  # abort if nginx cannot be installed
5
- return unless @node.install_package 'nginx'
8
+ return unless @node.install_package(@config['package'])
6
9
 
7
- @node.deploy_file "#{@template_path}/nginx.conf", '/etc/nginx/nginx.conf'
10
+ @node.deploy_file("#{@template_path}/nginx.conf", '/etc/nginx/nginx.conf', :binding => binding)
8
11
 
9
12
  # remove old sites that may be present
10
13
  msg = @node.messages.add('deleting old sites in /etc/nginx/sites-*')
11
14
  @node.rm '/etc/nginx/sites-*/*', :quiet => true
12
15
  msg.ok
13
16
 
14
- @config.each do |state, sites|
17
+ @config['sites'].each do |state, sites|
15
18
  sites.to_array.each do |site|
16
- @node.deploy_file "#{@template_path}/sites/#{site}", "/etc/nginx/sites-available/#{site}", :binding => binding
19
+ @node.deploy_file("#{@template_path}/sites/#{site}", "/etc/nginx/sites-available/#{site}", :binding => binding)
17
20
 
18
21
  # symlink to sites-enabled if this is listed as an enabled site
19
- if state == 'sites-enabled'
22
+ if state == 'enabled'
20
23
  msg = @node.messages.add("enabling #{site}", :indent => 2)
21
24
  msg.parse_result(@node.exec("cd /etc/nginx/sites-enabled && ln -s ../sites-available/#{site} #{site}")[:exit_code])
22
25
  end
@@ -25,11 +28,12 @@ class Nginx < Recipe
25
28
 
26
29
  # check configuration and restart nginx
27
30
  msg = @node.messages.add('checking nginx configuration')
28
- if @node.exec('/etc/init.d/nginx configtest')[:exit_code] == 0
31
+ ret = @node.exec('/etc/init.d/nginx configtest')
32
+ if ret[:exit_code] == 0
29
33
  msg.ok
30
34
  @node.restart_service('nginx') if options.restart?
31
35
  else
32
- msg.failed
36
+ msg.failed("\n" + ret[:stderr])
33
37
  end
34
38
  end
35
39
 
data/lib/dust/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dust
2
- VERSION = "0.13.11"
2
+ VERSION = "0.13.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dust-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.11
4
+ version: 0.13.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-18 00:00:00.000000000 Z
12
+ date: 2012-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json