Permalink
Browse files

Rewrite ngircd deps to use parameters.

  • Loading branch information...
1 parent f616497 commit 7ee1cf480575729c6c2d0dd67a90c6391d3f1dc1 @benhoskings committed Jul 11, 2012
Showing with 20 additions and 7 deletions.
  1. +16 −3 irc.rb
  2. +4 −4 ngircd/ngircd.conf.erb
View
19 irc.rb
@@ -1,4 +1,17 @@
-dep 'ngircd.managed' do
- installs { via :apt, 'ngircd' }
- cfg '/etc/ngircd/ngircd.conf'
+dep 'ngircd', :host, :description, :admin_email, :channels do
+ host.default("irc.#{shell('hostname -f')}")
+ description.default("#{hostname} IRC server")
+ admin_email.default("root@#{shell('hostname -f')}")
+ channels.ask("Channel names (space-separated, don't worry about the '#')")
+
+ requires 'ngircd.bin'
+
+ met? {
+ Babushka::Renderable.new().from?(dependency.load_path.parent / "nginx/vhost.conf.erb")
+ }
+ meet {
+ render_erb "nginx/vhost.conf.erb", :to => vhost_conf, :sudo => true
+ }
end
+
+dep 'ngircd.bin'
View
@@ -1,7 +1,7 @@
[Global]
- Name = <%= var :irc_hostname, :default => "irc.#{hostname}" %>
- Info = <%= var :irc_description, :default => "#{hostname} IRC server" %>
- AdminEMail = <%= var :admin_email, :default => "root@#{hostname}" %>
+ Name = <%= host %>
+ Info = <%= description %>
+ AdminEMail = <%= admin_email %>
Ports = 6667
@@ -17,7 +17,7 @@
MaxJoins = 10
<%
- var(:irc_channels).words.map {|chan|
+ channels.words.map {|chan|
chan.start_with '#'
}.each do |channel_name|
%>

0 comments on commit 7ee1cf4

Please sign in to comment.