We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The alternatives module's behavior should match what the alternatives command does.
Given:
$ sudo alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-17-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-17.0.3.0.7-1.el9_0.x86_64/bin/java) *+ 2 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.16.0.8-1.el9_0.x86_64/bin/java)
when I try to set an alternative for java to a specific command:
- name: configure default JDK become: true community.general.alternatives: name: java path: java-17-openjdk.x86_64
It will result in an error: Specified path java-17-openjdk.x86_64 does not exist
Specified path java-17-openjdk.x86_64 does not exist
Running alternatives from the command line like sudo alternatives --set java java-17-openjdk.x86_64 works and sets the expected alternative
sudo alternatives --set java java-17-openjdk.x86_64
Feature Idea
alternatives
The text was updated successfully, but these errors were encountered:
Files identified in the description:
plugins/modules/system/alternatives.py
If these files are incorrect, please update the component name section of the description or use the !component bot command.
component name
!component
click here for bot help
Sorry, something went wrong.
cc @mulby click here for bot help
plugins/modules/alternatives.py
I'd like to add my support for this issue. In the case of something like the rolling "java-latest-openjdk" package it's somewhat of a necessity:
# update-alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.372.b07-4.0.1.el8.x86_64/jre/bin/java) 2 java-latest-openjdk.x86_64 (/usr/lib/jvm/java-20-openjdk-20.0.1.0.9-8.rolling.el8.x86_64/bin/java)
+1. I would like this functionality as well. Any status updates on this? I'd rather not resort to use of the command or shell module.
Successfully merging a pull request may close this issue.
Summary
The alternatives module's behavior should match what the alternatives command does.
Given:
when I try to set an alternative for java to a specific command:
It will result in an error:
Specified path java-17-openjdk.x86_64 does not exist
Running alternatives from the command line like
sudo alternatives --set java java-17-openjdk.x86_64
works and sets the expected alternativeIssue Type
Feature Idea
Component Name
alternatives
Additional Information
Code of Conduct
The text was updated successfully, but these errors were encountered: