summaryrefslogtreecommitdiff
path: root/lib/dslkeywords/given.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dslkeywords/given.rb')
-rw-r--r--lib/dslkeywords/given.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dslkeywords/given.rb b/lib/dslkeywords/given.rb
index fa14e68..ba61703 100644
--- a/lib/dslkeywords/given.rb
+++ b/lib/dslkeywords/given.rb
@@ -17,6 +17,10 @@ module RCM
def met?
return false if @conds.key?(:hostname) && Socket.gethostname != @conds[:hostname].to_s
+ # When --hosts is specified, only run on the listed hosts
+ hosts = option(:hosts)
+ return false if hosts.any? && !hosts.include?(Socket.gethostname)
+
true
end
end