Pin erlang packages to version 19.3

Erlang 20 has been released and is not compatible with the current
release of RabbitMQ.[0] Pin erlang packages to the latest version
version supported by RabbitMQ 3.6.x, 19.3.

For package pinning to work correctly on Ubuntu, the priority of pinning
to a specific version needs to be higher than the priority of all
packages coming from the ESL repo.

For RedHat distros, the yum-versionlock plugin will need to be installed
and used to properly pin a package to a specific version.
[0] https://groups.google.com/forum/#!topic/rabbitmq-users/_imbAavBYjY

Combined back port of the following commits:
2a3091c9c2
c73e469e19

Change-Id: Ia8f053e499db7aa7c78c60213d3154d967b92a98
This commit is contained in:
Jimmy McCrory 2017-06-22 09:10:37 -07:00
parent cd9ed8e4bc
commit b7247285e5
2 changed files with 29 additions and 0 deletions

View File

@ -39,5 +39,8 @@ dependencies:
apt_pinned_packages:
- package: "*"
release: "Erlang Solutions Ltd."
- package: "erlang*"
version: "1:19.3*"
priority: 1000
when:
- ansible_pkg_mgr == 'apt'

View File

@ -73,6 +73,32 @@
tags:
- rabbitmq-repos
- name: Enable and set erlang repo priority
command: |
yum-config-manager
--enable {{ item.name }}
--setopt="{{ item.name }}.priority={{ item.priority }}"
changed_when: false
with_items:
- name: "{{ rabbitmq_erlang_repo.name }}"
priority: 40
tags:
- rabbitmq-repos
- name: Install yum versionlock plugin
yum:
name: "yum-plugin-versionlock"
state: "{{ rabbitmq_package_state }}"
tags:
- rabbitmq-yum-packages
- name: Lock version of erlang packages
command: yum versionlock add erlang*19.3*
register: yum_versionlock_erlang
changed_when: "yum_versionlock_erlang.stdout.find('versionlock added: 0') == -1"
tags:
- rabbitmq-yum-packages
- name: Install RabbitMQ package dependencies
yum:
pkg: "{{ item }}"