Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #627 from ripienaar/626
Browse files Browse the repository at this point in the history
(#626) special discovery handling for the built in scout agent
  • Loading branch information
ripienaar committed Jul 17, 2020
2 parents 49c1c13 + 3b57205 commit 2f01a8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/mcollective/agent/rpcutil.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ action "get_fact", :description => "Retrieve a single fact from the fact store"
:type => :string,
:validation => '^[\w\-\.]+$',
:optional => false,
:maxlength => 40
:maxlength => 256

output :fact,
:description => "The name of the fact being returned",
Expand Down
4 changes: 2 additions & 2 deletions lib/mcollective/discovery/choria.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def discover_collective(filter)
#
# Nodes are searched using an `and` operator via the discover_classes method
#
# When the `rpcutil` agent is required it will look for `Mcollective` class
# When the `rpcutil` or `scout` agent is required it will look for `Mcollective` class
# otherwise `Mcollective_avent_agentname` thus it will only find plugins
# installed using the `choria/mcollective` AIO plugin packager
#
# @param filter [Array<String>] agent names
# @return [Array<String>] list of nodes found
def discover_agents(filter)
pql = filter.map do |agent|
if agent == "rpcutil"
if ["rpcutil", "scout"].include?(agent)
discover_classes(["mcollective::service"])
elsif agent =~ /^\/(.+)\/$/
'resources {type = "File" and tag ~ "mcollective_agent_.*?%s.*?_server"}' % [string_regexi($1)]
Expand Down

0 comments on commit 2f01a8b

Please sign in to comment.