zabbix icon indicating copy to clipboard operation
zabbix copied to clipboard

agent_registration - Search all recipes on a node for zabbix::server

Open iandelahorne opened this issue 12 years ago • 4 comments

If a role containing recipe[zabbix::server] is in the run_list of a node, the node won't be found by searching for recipe:zabbix::server. Instead, search for recipes:zabbix::server.

Ideally this would be a role (configurable in attributes) we search for instead of just looking for the recipe.

Attached a diff since my master is out of sync.

diff --git a/recipes/agent_registration.rb b/recipes/agent_registration.rb
index 260d55e..ab3c36f 100644
--- a/recipes/agent_registration.rb
+++ b/recipes/agent_registration.rb
@@ -6,7 +6,7 @@
 #

 unless Chef::Config[:solo]
-  zabbix_server = search(:node, "recipe:zabbix\\:\\:server").first
+  zabbix_server = search(:node, "recipes:zabbix\\:\\:server").first
 else
   if node['zabbix']['web']['fqdn']
     zabbix_server = node

iandelahorne avatar Jan 02 '14 14:01 iandelahorne

Hi @lflux Thanks for your merge request, @guilhem your the master of this part of the code can you review it ?

laradji avatar Jan 06 '14 13:01 laradji

I agree with "recipes" instead of "recipe".

This was changed in past 25da4552f9ff6736a21ed142fd90dd964a4a1389 without any good reason (I think)

guilhem avatar Jan 06 '14 13:01 guilhem

sorry my bad

guilhem avatar Feb 06 '14 17:02 guilhem

#141 must fix this issue

guilhem avatar Feb 09 '14 14:02 guilhem