Project

General

Profile

User story #12710

Add a package techniques migration script

Added by Félix DALLIDET 7 months ago. Updated about 2 months ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Suggestion strength:
User visibility:
Effort required:

Description

Old package techniques are no longer maintained, we should provide a way to slightly automate the migration process.
Some parameters will be lost in the process: the custom check interval, the condition statement on versions, the "update only" option and the posthook boolean.

To avoid any big changes in configuration, the script creates a new directive from the old one, using the new package technique, adding "_migrated" to its displayName.
The script will abort any upgrade including unsafe changes like:
-upgrading directive sing version condition statement
-upgrading directive including inactive but defined posthook command

If the script succeeds, it will not replace the old directive but only create a new one, without attaching it to a rule.
The proper call to 'directive-replace' introduced by #12614 will be printed to let the user replace the directive after checking it if he wants to.


Related issues

Related to Rudder - User story #10276: I Can not migrate from old "package technique" to new one automaticallyRejected

Associated revisions

Revision 90192844 (diff)
Added by Félix DALLIDET 4 months ago

Fixes #12710: Add a package techniques migration script

History

#1 Updated by Félix DALLIDET 7 months ago

  • Status changed from New to In progress
  • Assignee set to Félix DALLIDET

#2 Updated by Félix DALLIDET 7 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Félix DALLIDET to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-agent/pull/177

#3 Updated by Vincent MEMBRÉ 6 months ago

  • Target version changed from 4.3.2 to 4.3.3

#4 Updated by Félix DALLIDET 6 months ago

The parameters mapping is done as described bellow:
'<>' is used for a non present arg

RPM old technique:
  • RPM_PACKAGE_CHECK_INTERVAL => Null
  • RPM_PACKAGE_REDLIST => PACKAGE_LIST
  • RPM_PACKAGE_REDACTION => PACKAGE_STATE add:present delete:remove update:present <>:any
  • RPM_PACKAGE_VERSION_DEFINITION => PACKAGE_VERSION default:default specific:specific
  • RPM_PACKAGE_VERSION_CRITERION => ==:<>(no equivalent but continue) !=/>=/<=/:abort the technique upgrade
  • RPM_PACKAGE_VERSION => PACKAGE_VERSION_SPECIFIC (abort if empty and RPM_PACKAGE_VERSION_DEFINITION set to specific)
  • RPM_PACKAGE_PACKAGE_POST_HOOK_RUN => <>
  • RPM_PACKAGE_PACKAGE_POST_COMMAND => PACKAGE_POST_HOOK_COMMAND (abort if a command is defined but RPM_PACKAGE_PACKAGE_POST_HOOK_RUN was unchecked)
    No options, default architecture, untrusted packages set to false
APT old technique:
  • APT_PACKAGE_APTLIST => PACKAGE_LIST
  • APT_PACKAGE_ALLOW_UNTRUSTED => PACKAGE_MANAGER_ALLOW_UNTRUSTED true:true false:false
  • APT_PACKAGE_DEBACTION => PACKAGE_STATE add:present delete:remove update:present <>:any
  • APT_PACKAGE_VERSION_DEFINITION => PACKAGE_VERSION default:default specific:specific
  • APT_PACKAGE_VERSION_CRITERION => ==:<>(no equivalent but continue) !=/>=/<=/:abort the technique upgrade
  • APT_PACKAGE_VERSION => PACKAGE_VERSION_SPECIFIC (abort if empty and APT_PACKAGE_VERSION_DEFINITION set to specific)
    No posthook defined, no options defined, default architecture

Moreover, it creates the directive when succeeding but does not replace the old one in the rule nor destroy it to allow human check afterward.

#5 Updated by Alexis MOUSSET 6 months ago

  • Category set to Agent

#6 Updated by Vincent MEMBRÉ 5 months ago

  • Target version changed from 4.3.3 to 4.3.4

#7 Updated by Benoît PECCATTE 5 months ago

  • Target version changed from 4.3.4 to 4.3.5

#8 Updated by Félix DALLIDET 4 months ago

  • Status changed from Pending technical review to Pending release

#9 Updated by Vincent MEMBRÉ about 2 months ago

  • Status changed from Pending release to Released
This bug has been fixed in Rudder 4.3.5 and 5.0.1 which were released today.
Changelog
Changelog

#10 Updated by Alexis MOUSSET about 1 month ago

  • Related to User story #10276: I Can not migrate from old "package technique" to new one automatically added

Also available in: Atom PDF