private
def update_facts(global_options, options, args)
- nodes = manager.filter(args)
+ nodes = manager.filter(args, :local => false)
new_facts = {}
ssh_connect(nodes) do |ssh|
ssh.leap.run_with_progress(facter_cmd) do |response|
#
# if conditions is prefixed with +, then it works like an AND. Otherwise, it works like an OR.
#
- def filter(filters)
+ # options:
+ # :local -- if :local is false and the filter is empty, then local nodes are excluded.
+ #
+ def filter(filters, options={})
if filters.empty?
- return nodes
+ if options[:local] === false
+ return nodes[:environment => '!local']
+ else
+ return nodes
+ end
end
if filters[0] =~ /^\+/
# don't let the first filter have a + prefix