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 #13622: Add a flag library #847

Conversation

amousset
Copy link
Member

Copy link
Member

@ncharles ncharles left a 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";
Copy link
Member

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

Copy link
Member Author

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",
Copy link
Member

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

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 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}"),
Copy link
Member

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 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@amousset amousset force-pushed the arch_13622/add_a_flag_library branch from 7d9329d to 33e8bb4 Compare October 15, 2018 14:36
@amousset
Copy link
Member Author

Commit modified

@@ -16,6 +16,13 @@ bundle common ncf_inputs

}

# Load a custom ncf.conf for tests
Copy link
Member Author

@amousset amousset Oct 15, 2018

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.

@amousset amousset force-pushed the arch_13622/add_a_flag_library branch from 33e8bb4 to d9cca05 Compare October 15, 2018 14:44
@amousset
Copy link
Member Author

Commit modified

@amousset amousset force-pushed the arch_13622/add_a_flag_library branch from d9cca05 to 5e744cb Compare October 15, 2018 15:13
@amousset
Copy link
Member Author

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");
Copy link
Member

Choose a reason for hiding this comment

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

this is very neat

@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 5e744cb into Normation:branches/rudder/4.3 Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants