Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #14581: Errors at Rudder 5 installation about missing policy_server.dat #1426

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions techniques/system/common/1.0/update.st
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,23 @@ bundle common server_info
string => translatepath("${sys.workdir}/policy_server.dat"),
comment => "Path to file containing address to policy server";

pass2.policy_server_file_exists::
"policy_server" string => readfile("${policy_server_file}", 2048);

pass2.!policy_server_file_exists::
# Use "" as default policy_server if no policy_server.dat exists
"policy_server" string => ifelse(fileexists("${policy_server_file}"),
readfile("${policy_server_file}", 2048),
"");
"policy_server" string => "";

pass2::
"cfserved" string => "${policy_server}";

classes:
"should_disable_server" expression => fileexists("${g.rudder_disable_server_file}");
"should_disable_server" expression => fileexists("${g.rudder_disable_server_file}");

"policy_server_file_exists" expression => fileexists("${policy_server_file}");

"pass2" expression => "pass1";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should not have pass2 here !!!! these are GLOBAL classes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it breaks 14592 because having to define variable in bundle common with two passes fails

"pass1" expression => "any";
}

# The update is now split in two parts
Expand Down