-
Notifications
You must be signed in to change notification settings - Fork 38
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 #13622: Add a flag library #847
Fixes #13622: Add a flag library #847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome !!!
"cfengine_port" string => "5308"; | ||
pass2.!flag_file_defined:: | ||
"flag_file" string => "/var/rudder/agent-data/flags.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need something to create this folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this should be part of the system techniques I think
"${configuration.flag_file}" | ||
create => "true", | ||
template_method => "mustache", | ||
edit_template => "${sys.workdir}/modules/templates/datastate.json.tpl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are missing this file in the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already used for jinja templating.
|
||
# Pass3 to avoid reading the json at each pass... | ||
pass3.file_exists:: | ||
"ncf_flags.data" data => readjson("${configuration.flag_file}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you document somewhere in the file the expected format of flag file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
7d9329d
to
33e8bb4
Compare
Commit modified |
@@ -16,6 +16,13 @@ bundle common ncf_inputs | |||
|
|||
} | |||
|
|||
# Load a custom ncf.conf for tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was needed to use a different flag file.
33e8bb4
to
d9cca05
Compare
Commit modified |
d9cca05
to
5e744cb
Compare
Commit modified |
"ok_5" expression => strcmp("${test.set5[1]}", "ok"); | ||
"ok_6" expression => strcmp("${test.get6[1]}", "set"); | ||
"ok_7" expression => strcmp("${test.set7[1]}", "notreserved"); | ||
"ok_8" expression => strcmp("${test.get8[1]}", "set"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very neat
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/13622