Project

General

Profile

User story #11257

Do not send inventory if a forwarder/uploader daemon exists

Added by Janos Mattyasovszky 4 months ago. Updated about 2 months ago.

Status:
Released
Priority:
N/A
Category:
Initial promises & sys tech
Target version:
Target version (plugin):
Suggestion strength:
Advise - This would make Rudder significantly better | easier | simpler
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:

Description

For implementing a custom inventory forwarder/uploader daemon, following code of the policy needs some additional case handling, so it's not run if a file exists (to bedefined):

diff --git a/techniques/system/distributePolicy/1.0/propagatePromises.st b/techniques/system/distributePolicy/1.0/propagatePromises.st
index e266871..28d604f 100644
--- a/techniques/system/distributePolicy/1.0/propagatePromises.st
+++ b/techniques/system/distributePolicy/1.0/propagatePromises.st
@@ -229,20 +229,21 @@ bundle agent sendInventoryToCmdb

   files:
     # Root server and relay-top send to the endpoint, every other send as usual to their policy server
-    root_server|role_rudder_relay_top::
-
-      "${incoming_inventory_files}" 
-        transformer => "${g.rudder_tools}/send-clean.sh ${rudder_inventory_endpoint} ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
-        classes => rudder_common_classes("rudder_inventory_processing"),
-        ifvarclass => "!rudder_inventory_processing_error",
-        comment => "Processing a local inventory";
-
-      "${updates_inventory_files}" 
-        transformer => "${g.rudder_tools}/send-clean.sh ${rudder_inventory_endpoint} ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
-        classes => rudder_common_classes("rudder_inventory_processing"),
-        ifvarclass => "!rudder_inventory_processing_error",
-        comment => "Processing a local inventory";
-
+#### Replaced by daemon
+##    root_server|role_rudder_relay_top::
+##
+##      "${incoming_inventory_files}" 
+##        transformer => "${g.rudder_tools}/send-clean.sh ${rudder_inventory_endpoint} ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
+##        classes => rudder_common_classes("rudder_inventory_processing"),
+##        ifvarclass => "!rudder_inventory_processing_error",
+##        comment => "Processing a local inventory";
+##
+##      "${updates_inventory_files}" 
+##        transformer => "${g.rudder_tools}/send-clean.sh ${rudder_inventory_endpoint} ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
+##        classes => rudder_common_classes("rudder_inventory_processing"),
+##        ifvarclass => "!rudder_inventory_processing_error",
+##        comment => "Processing a local inventory";
+##

Related issues

Related to Rudder - Bug #11648: Unexpected report for Send inventories to CMDB after #11257 Released

Associated revisions

Revision fdc31cf2
Added by Benoît PECCATTE about 2 months ago

Fixes #11257: Do not send inventory if a forwarder/uploader daemon exists

History

#1 Updated by Nicolas CHARLES 4 months ago

Hi Janos,

Does it break something to have both the forward/uploader daemon plus the policy to upload promises?
From my understanding, inventories are sent asap by the daemon, so the policy could act as a fallback, unless i'm missing something

#2 Updated by Janos Mattyasovszky 4 months ago

I have never tried it, but there might be hidden race cases, which I simply did not want to debug if I did not need to..

Alternate solution is a patch to exit 0; in the second line of /opt/rudder/share/tools/send-clean.sh :)

#3 Updated by Benoît PECCATTE about 2 months ago

  • Target version set to 3.1.24

#4 Updated by Benoît PECCATTE about 2 months ago

  • Status changed from New to In progress
  • Assignee set to Benoît PECCATTE

#5 Updated by Benoît PECCATTE about 2 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Benoît PECCATTE to Alexis MOUSSET
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1211

#6 Updated by Benoît PECCATTE about 2 months ago

  • Status changed from Pending technical review to Pending release

#7 Updated by Janos Mattyasovszky about 2 months ago

  • Related to Bug #11648: Unexpected report for Send inventories to CMDB after #11257 added

#8 Updated by Vincent MEMBRÉ about 2 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.24, 4.1.8 and 4.2.1 which were released today.

Also available in: Atom PDF