We're using ansible to configure our CentOS 6 servers, and we have a task to install a specific version of a package:
- name: install thrift2 yum: name=ripencc-thrift2-{{ version }}
In this ansible task, the "version" variable is set by the operator. When we want to upgrade, it works. But today we had to downgrade, and noticed that ansible wasn't downgrading it. So we tried by hand (the installed version was 1.0.8):
# yum install ripencc-thrift2-1.0.3
I don't have the output handy, because a colleague was working on it, but basically, yum said something like "package already installed" and refused to downgrade it, even though the package is in our repository.
I have a strong sense that yum _used to_ downgrade packages if asked to install an older version, but perhaps I am misremembering.
Nevertheless, I want to ask: is this a bug in yum? If asked to install a specific version, should it not upgrade OR downgrade as needed?
Regards, Anand
Use the 'downgrade' option.
https://access.redhat.com/solutions/29617
On Thu, Jun 1, 2017 at 1:46 PM, Anand Buddhdev anandb@ripe.net wrote:
We're using ansible to configure our CentOS 6 servers, and we have a task to install a specific version of a package:
- name: install thrift2 yum: name=ripencc-thrift2-{{ version }}
In this ansible task, the "version" variable is set by the operator. When we want to upgrade, it works. But today we had to downgrade, and noticed that ansible wasn't downgrading it. So we tried by hand (the installed version was 1.0.8):
# yum install ripencc-thrift2-1.0.3
I don't have the output handy, because a colleague was working on it, but basically, yum said something like "package already installed" and refused to downgrade it, even though the package is in our repository.
I have a strong sense that yum _used to_ downgrade packages if asked to install an older version, but perhaps I am misremembering.
Nevertheless, I want to ask: is this a bug in yum? If asked to install a specific version, should it not upgrade OR downgrade as needed?
Regards, Anand _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On 01/06/2017 22:29, Tate Belden wrote:
Use the 'downgrade' option.
Thanks Tate. I know the "downgrade" option well. I wouldn't have posted my question if it were that simple.
As I said previously, we use ansible, and its "yum" module invokes:
yum install package-version-release
I expect yum to honour this, and downgrade a package if necessary, but it's not doing that.
Given the lack of opinions here, I'll file a bugzilla report and see what the maintainers say.
Regards, Anand
Personally, I would do one of three things:
1. Use the -m command to run 'yum install <version>' which /might/ work.
2. Uninstall the newer package and install the version you want. (Check the 'state' directive to do this.)
3. Pin that package version when creating the server/VM so as not to be updated.
#3 is useful to us as we kickstart all our servers and VMs, and this eliminates the problem going forward. Then, when we're ready to upgrade the pinned package, we have an ansible playbook that unpins that version, installs the new version (even if not latest), then re-pins.
HTH.
On 06/01/2017 03:46 PM, Anand Buddhdev wrote:
We're using ansible to configure our CentOS 6 servers, and we have a task to install a specific version of a package:
- name: install thrift2 yum: name=ripencc-thrift2-{{ version }}
In this ansible task, the "version" variable is set by the operator. When we want to upgrade, it works. But today we had to downgrade, and noticed that ansible wasn't downgrading it. So we tried by hand (the installed version was 1.0.8):
# yum install ripencc-thrift2-1.0.3
I don't have the output handy, because a colleague was working on it, but basically, yum said something like "package already installed" and refused to downgrade it, even though the package is in our repository.
I have a strong sense that yum _used to_ downgrade packages if asked to install an older version, but perhaps I am misremembering.
Nevertheless, I want to ask: is this a bug in yum? If asked to install a specific version, should it not upgrade OR downgrade as needed?
Regards, Anand _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On 2 Jun 2017 1:28 pm, "Mark Haney" mark.haney@neonova.net wrote:
Personally, I would do one of three things:
1. Use the -m command to run 'yum install <version>' which /might/ work.
2. Uninstall the newer package and install the version you want. (Check the 'state' directive to do this.)
3. Pin that package version when creating the server/VM so as not to be updated.
#3 is useful to us as we kickstart all our servers and VMs, and this eliminates the problem going forward. Then, when we're ready to upgrade the pinned package, we have an ansible playbook that unpins that version, installs the new version (even if not latest), then re-pins.
HTH.
On 06/01/2017 03:46 PM, Anand Buddhdev wrote:
We're using ansible to configure our CentOS 6 servers, and we have a task to install a specific version of a package:
- name: install thrift2 yum: name=ripencc-thrift2-{{ version }}
In this ansible task, the "version" variable is set by the operator. When we want to upgrade, it works. But today we had to downgrade, and noticed that ansible wasn't downgrading it. So we tried by hand (the installed version was 1.0.8):
# yum install ripencc-thrift2-1.0.3
I don't have the output handy, because a colleague was working on it, but basically, yum said something like "package already installed" and refused to downgrade it, even though the package is in our repository.
I have a strong sense that yum _used to_ downgrade packages if asked to install an older version, but perhaps I am misremembering.
Nevertheless, I want to ask: is this a bug in yum? If asked to install a specific version, should it not upgrade OR downgrade as needed?
Regards, Anand _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
_______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
The present version of ansible can't handle downgrades with the yum module
There's been a few discussions of this over time but this is the most recent I think, and it looks like it might get fixed on 2.4 perhaps
https://github.com/ansible/ansible/issues/21516
If you want to do a specific version you are better off not using the yum module at present but rather shell/command to do so instead.