You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The alternatives module does not handle alternatives with families on CentOS-based systems. The module appears to fail to properly parse the output of update-alternatives --display <item>, confusing it into running update-alternatives --install which destroys the package's original alternatives configuration. This happens for example with Java alternatives, where tools such as keytool cannot be invoked after configuring with this module.
Debian-based systems do not seem to support alternative families and do not exhibit this problem.
Note: while this bug has been encountered on an obsolete version of Ansible, the bug does currently exist on the main branch, as this regex cannot handle the family format:
On a CentOS 8 environnment, install two JDKs (yum install java-1.8.0-openjdk-headless.x86_64 java-11-openjdk-headless.x86_64) and run a playbook containing the following task, replacing path with the actual package version installed:
Summary
The alternatives module does not handle alternatives with families on CentOS-based systems. The module appears to fail to properly parse the output of
update-alternatives --display <item>
, confusing it into runningupdate-alternatives --install
which destroys the package's original alternatives configuration. This happens for example with Java alternatives, where tools such askeytool
cannot be invoked after configuring with this module.Debian-based systems do not seem to support alternative families and do not exhibit this problem.
Note: while this bug has been encountered on an obsolete version of Ansible, the bug does currently exist on the main branch, as this regex cannot handle the family format:
community.general/plugins/modules/system/alternatives.py
Line 107 in e0b731e
Issue Type
Bug Report
Component Name
alternatives
Ansible Version
Note: as noted above, bug exists on the main branch too.
Community.general Version
Note: as noted above, bug exists on the main branch too.
Configuration
OS / Environment
CentOS 8
Steps to Reproduce
On a CentOS 8 environnment, install two JDKs (
yum install java-1.8.0-openjdk-headless.x86_64 java-11-openjdk-headless.x86_64
) and run a playbook containing the following task, replacingpath
with the actual package version installed:Expected Results
Java alternative links (both main and slaves) points to Java 11, as if the following command was executed:
Actual Results
Java main alternative link points to Java 11, but slave links, family and original priority information are lost:
Code of Conduct
The text was updated successfully, but these errors were encountered: