Project

General

Profile

Actions

User story #11257

closed

Do not send inventory if a forwarder/uploader daemon exists

Added by Janos Mattyasovszky over 7 years ago. Updated about 7 years ago.

Status:
Released
Priority:
N/A
Category:
System techniques
Target version:
UX impact:
Suggestion strength:
Advise - This would make Rudder significantly better | easier | simpler
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Name check:
Fix check:
Regression:

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 1 (0 open1 closed)

Related to Rudder - Bug #11648: Unexpected report for Send inventories to CMDB after #11257ReleasedAlexis MoussetActions
Actions #1

Updated by Nicolas CHARLES over 7 years 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

Actions #2

Updated by Janos Mattyasovszky over 7 years 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 :)

Actions #3

Updated by Benoît PECCATTE about 7 years ago

  • Target version set to 3.1.24
Actions #4

Updated by Benoît PECCATTE about 7 years ago

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

Updated by Benoît PECCATTE about 7 years 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
Actions #6

Updated by Benoît PECCATTE about 7 years ago

  • Status changed from Pending technical review to Pending release
Actions #7

Updated by Janos Mattyasovszky about 7 years ago

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

Updated by Vincent MEMBRÉ about 7 years 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.

Actions

Also available in: Atom PDF