-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #14857: Add certificate to inventory in fusion
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
rudder-agent/SOURCES/patches/fusioninventory/14857_use_rudder_certificate.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- a/lib/FusionInventory/Agent/Task/Inventory/Generic/Rudder.pm | ||
+++ b/lib/FusionInventory/Agent/Task/Inventory/Generic/Rudder.pm | ||
@@ -181,9 +181,8 @@ | ||
my @agents; | ||
|
||
# Potential agent directory candidates | ||
- my %agent_candidates = ( '/var/rudder/cfengine-community' => 'cfengine-community', | ||
- '/var/rudder/cfengine-nova' => 'cfengine-nova', | ||
- 'C:/Program Files/Cfengine' => 'cfengine-nova', | ||
+ my %agent_candidates = ( '/var/rudder/cfengine-community' => 'cfengine-community', | ||
+ 'C:/Program Files/Rudder/etc' => 'dsc', | ||
); | ||
|
||
foreach my $candidate (keys(%agent_candidates)){ | ||
@@ -195,7 +194,13 @@ | ||
my $agent_name = "$agent_candidates{${candidate}}"; | ||
my $server_hostname_file = "${candidate}/policy_server.dat"; | ||
my $uuid_file = "${candidate}/rudder-server-uuid.txt"; | ||
- my $cfengine_key_file = "${candidate}/ppkeys/localhost.pub"; | ||
+ my $certificate_file = "${candidate}/ssl/localhost.cert"; | ||
+ | ||
+ if ($agent_name eq "dsc") { | ||
+ $uuid_file = 'C:/Program Files/Rudder/policy/rudder-server-uuid.txt'; | ||
+ } else { | ||
+ $certificate_file = '/opt/rudder/etc/ssl/localhost.cert'; | ||
+ } | ||
|
||
# get policy server hostname | ||
my $serverHostname = getFirstLine ( | ||
@@ -217,8 +222,8 @@ | ||
chomp $serverUuid; | ||
|
||
# get CFengine public key | ||
- my $cfengineKey = getAllLines( | ||
- file => $cfengine_key_file | ||
+ my $certificate = getAllLines( | ||
+ file => $certificate_file | ||
); | ||
|
||
# get owner name | ||
@@ -231,7 +236,7 @@ | ||
my $agent = { | ||
AGENT_NAME => $agent_name, | ||
POLICY_SERVER_HOSTNAME => $serverHostname, | ||
- CFENGINE_KEY => $cfengineKey, | ||
+ AGENT_CERT => $certificate, | ||
OWNER => $owner, | ||
POLICY_SERVER_UUID => $serverUuid, | ||
}; |