Skip to content

Commit

Permalink
Merge pull request #289 from StackStorm/pin_rabbitmq
Browse files Browse the repository at this point in the history
Pin rabbitmq version on EL8
  • Loading branch information
amanda11 authored Mar 5, 2021
2 parents 455aa43 + e8a6a27 commit 70300aa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
# Run Ansible-lint checks
ansible-lint:
docker:
- image: yokogawa/ansible-lint
- image: yokogawa/ansible-lint:v4.3.7
steps:
- checkout
- run:
Expand Down
17 changes: 16 additions & 1 deletion roles/StackStorm.rabbitmq/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
when: rabbitmq_on_el8
tags: rabbitmq

- name: Install rabbitmq package on {{ ansible_facts.distribution }}
- name: Install latest rabbitmq package on {{ ansible_facts.distribution }}
become: yes
package:
name: rabbitmq-server
Expand All @@ -41,6 +41,21 @@
notify:
- restart rabbitmq
tags: rabbitmq
when: rabbitmq_version == "present"

- name: Install pinned rabbitmq package on {{ ansible_facts.distribution }}
become: yes
package:
name: "rabbitmq-server{{ '=' if ansible_facts.pkg_mgr == 'apt' else '-' }}{{ rabbitmq_version }}"
state: present
register: _task
retries: 5
delay: 3
until: _task is succeeded
notify:
- restart rabbitmq
tags: rabbitmq
when: rabbitmq_version != "present"

- name: Ensure rabbitmq is enabled and running
become: yes
Expand Down
4 changes: 4 additions & 0 deletions roles/StackStorm.rabbitmq/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
---
rabbitmq_on_el8: "{{ (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8') }}"
# RabbitMQ version to use. Use present for latest. For EL8 we need to pin
# to 3.8.12 or earlier, as later version requires erlang not available in
# EL8 or epel repositories
rabbitmq_version: "{{ (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8') | ternary('3.8.12','present') }}"

0 comments on commit 70300aa

Please sign in to comment.