-
Notifications
You must be signed in to change notification settings - Fork 22
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 #18909: Add an "upgrade only" option to the technique packageManagement #1650
Fixes #18909: Add an "upgrade only" option to the technique packageManagement #1650
Conversation
this is just an initial commit for reference |
PR updated with a new commit |
@@ -45,6 +37,10 @@ | |||
<LABEL>Absent</LABEL> | |||
<VALUE>absent</VALUE> | |||
</ITEM> | |||
<ITEM> | |||
<LABEL>Only if already installed</LABEL> |
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.
"Upgrade only if already installed" or something like that ?
|
||
methods: | ||
pass1:: | ||
# Force t oaudit mode to verify if packages are already installed (whatever their version is) |
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 should be done only if "state_upgrade_only_${index_pkg}"
@@ -121,5 +156,7 @@ bundle agent package_management_&RudderUniqueID& { | |||
|
|||
"report_${index_pkg}" usebundle => rudder_common_reports_generic_index("packageManagement", "${class_prefix_script[${index_pkg}]}", "${trackingkey[${index_pkg}]}", "Post-modification script", "${package[${index_pkg}]}", "Execution of the post-modification script", "${index_pkg}"), | |||
ifvarclass => "posthook_specified_${index_pkg}.${inner_class_prefix_${index_pkg}}_repaired"; | |||
|
|||
reports: |
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.
why the empty report ?
PR updated with a new commit |
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.
some minor comments.
I'll check the code as well on a rudder instance
|
||
methods: | ||
pass1:: | ||
# Force to audit mode to verify if packages are already installed (whatever their version is) | ||
"remove_dry_run_mode" usebundle => push_dry_run_mode("true"); |
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.
shouldn't it be "force dry_run_mode" ? even if it's only a comment, it would help
|
||
"report_${index_pkg}" usebundle => rudder_common_reports_generic_index("packageManagement", "${inner_class_prefix_${index_pkg}}", "${trackingkey[${index_pkg}]}", "Package", "${package[${index_pkg}]}", "${state_description[${index_pkg}]} of package ${package[${index_pkg}]}${architecture_description[${index_pkg}]}${version_description[${index_pkg}]}", "${index_pkg}"); | ||
# Report special case when the state is "upgrade only" and the package was not found on the machine | ||
"report_na_${index_pkg}" usebundle => rudder_common_report("packageManagement", "result_na", "${trackingkey[${index_pkg}]}", "Package", "${package[${index_pkg}]}", "Upgrade only set but the package was not found on the machine."), |
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.
"report_na_${index_pkg}" usebundle => rudder_common_report("packageManagement", "result_na", "${trackingkey[${index_pkg}]}", "Package", "${package[${index_pkg}]}", "Upgrade only set but the package was not found on the machine."), | |
"report_na_${index_pkg}" usebundle => rudder_common_report_index("packageManagement", "result_na", "${trackingkey[${index_pkg}]}", "Package", "${package[${index_pkg}]}", "Upgrade only set for package ${package[${index_pkg}]} but this package was not found on the machine.", "${index_pkg}"), |
pass1:: | ||
# Force to audit mode to verify if packages are already installed (whatever their version is) | ||
"remove_dry_run_mode" usebundle => push_dry_run_mode("true"); | ||
"already_installed_${index_pkg}" usebundle => package_state_options("${package[${index_pkg}]}", "any", "${architecture[${index_pkg}]}", "${manager[${index_pkg}]}", "present", "${manager_final_options[${index_pkg}]}"), |
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.
if we have two different technique, one with upgrade only first and the second with install, it will skip the install part and fail
# The pass2 is not strictly necessary but prevent future issues if the behavior of pre-evaluation changes (because the evaluation of vars + classes takes 2 passes) | ||
pass2:: | ||
# Package | ||
"package_${index_pkg}" usebundle => package_state_options("${package[${index_pkg}]}", "${version[${index_pkg}]}", "${architecture[${index_pkg}]}", "${manager[${index_pkg}]}", "${ncf_state[${index_pkg}]}", "${manager_final_options[${index_pkg}]}"), |
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 not correctly executed
I have reports:
verbose: P: From parameterized bundle: _log_v3( {"Presence of package tree in any version","htop","package_state_options_htop","package_state_options_htop_any_default_default_present_","@{args}"})
when calling first with upgrade only, then present
inverting the order partially solved the issue - package is installed
** Add options for package managers | ||
-- Nicolas Charles <nicolas.charles@normation.com> Thu Dec 7 17:16:30 2017 | ||
* Version 1.2 | ||
** Convert to multiversionned technique |
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 misses a changelog entry, stating that Felix the great has done this version
PR updated with a new commit |
PR updated with a new commit |
PR updated with a new commit |
-- Nicolas Charles <nicolas.charles@normation.com> Thu Dec 7 17:16:30 2017 | ||
* Version 1.2 | ||
** Convert to multiversionned technique | ||
-- Félix Dallidet <felix.dallidet@rudder.io> Thu Mar 1 10:23:30 2021 |
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.
-- Félix Dallidet <felix.dallidet@rudder.io> Thu Mar 1 10:23:30 2021 | |
-- Félix Dallidet <felix.dallidet@rudder.io> Mon Mar 1 10:23:30 2021 |
* Version 1.2 | ||
** Convert to multiversionned technique | ||
-- Félix Dallidet <felix.dallidet@rudder.io> Thu Mar 1 10:23:30 2021 | ||
* Version 1.2 |
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.
* Version 1.2 | |
* Version 1.3 |
PR updated with a new commit |
This PR is not mergeable to upper versions. |
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 missing the change of list of maintaine version
PR updated with a new commit |
This PR is not mergeable to upper versions. |
OK, squash merging this PR |
225abab
to
d9ac7c3
Compare
https://issues.rudder.io/issues/18909