I am using Ansible command module to downgrade the package (assuming higher version is already installed and
repo has both lower and higher version). I dont want to use Anisble yum module due to some constraints.
I am not able to invoke yum downgrade from command module.
I am using Ansible command module to downgrade the package (assuming higher version is already installed and
repo has both lower and higher version). I dont want to use Anisble yum module due to some constraints.
I am not able to invoke yum downgrade from command module.
What does this mean?
Did you get an error message?
Or did the task run OK but the package wasn’t downgraded?
Without knowing what you did it’s impossible to help. So please show the task.
You should be able to invoke any command using the command module.
Dick
This is the playbook.
I think you just need the '-y' switch.
yum -y downgrade <rpm_name>
No -y option also does not work. Well yum downgrade is a valid command and working outside Ansible.
Run playbook with ‘-vv’ appended and show us the output.
kind regards
Pshem
Well , I tried again and found some abnormal behaviour.
Observed once i use -y option as below:
Could it be that this is some custom package and that it’s installation somehow depends on environment variables being present?
What is the rpmname?
Dick
Yes , its custom enterprise specific rpm . But if i do manually (outside ansible), these commands work perfectly . Morover it dont have any dependency on other rpm and even on env.
Exactly, by doing it manually your environment has different variables set.
What happens if you use the shell module instead of command?
Well , it is same behavior as of command module . i.e if I use -y option , both rpms will be there in system and task is stuck and i have to manually terminate.
How is it possible, 2 version of same rpms on machine and even task is stuck.
Can you clarify what constraint the “yum” module has as I would be surprised if it can’t accommodate all common yum related tasks? Can’t you just specify package name with version (name) and enable downgrade (allow_downgrade)?
https://docs.ansible.com/ansible/latest/modules/yum_module.html#yum-module
Regards
Phil
Hi Phil,
I have already filed a issue as requested by Ansible Team, All Details can be found here:
https://github.com/ansible/ansible/issues/59146’
Regards
Rahul
See what you mean now. Seems that others have raised a similar issue, previously, but not sure there has ever been a resolution? Possibly worth searching for something useful in Galaxy perhaps (see eg below, if not used before)?
ansible-galaxy search plugins
ansible-galaxy info
Regards
Phil
Thanks … I am not sure , if enable_plugin option under YUM ansible module is related to such plugins , as description in documentation is not sufficient for end user to understand.
I am looking for smallest play which make use of enable_plugin option while using yum module for better understanding of same.
Regards
Rahul