lib/asbestos/host.rb in asbestos-0.0.6 vs lib/asbestos/host.rb in asbestos-0.0.7
- old
+ new
@@ -38,11 +38,11 @@
Asbestos.with_indifferent_access! @chains
Asbestos.with_indifferent_access! @interfaces
Asbestos.with_indifferent_access! @addresses
- if Asbestos.hostname.to_sym == @name
+ if generating_rules_for_current_host?
Asbestos.interfaces.each do |if_name, info|
@addresses[if_name] = info[:inet_addr]
end
end
@@ -55,11 +55,10 @@
end
self.class.all[name] = self
end
-
def debug
[
"Hostname: #{@name}",
(@template ? " Template: #{@template}" : nil),
" Interfaces: #{@interfaces}",
@@ -81,9 +80,16 @@
#
# DSL ------------------------------------------------------------------------------
#
+
+ #
+ # Indicates if Asbestos is generating rules for the host it's running on
+ #
+ def generating_rules_for_current_host?
+ Asbestos.hostname.to_s == @name.to_s
+ end
#
# Places this host in a named group
#
# host 'dax' do