diff --git a/roles/StackStorm.rabbitmq/defaults/main.yml b/roles/StackStorm.rabbitmq/defaults/main.yml index 09f572f5..e5308236 100644 --- a/roles/StackStorm.rabbitmq/defaults/main.yml +++ b/roles/StackStorm.rabbitmq/defaults/main.yml @@ -5,3 +5,5 @@ rabbitmq_plugins: [] # - rabbitmq_management # Set to "present" to install latest version, or specify specific version rabbitmq_version: "present" +# Use version or wildcard +erlang_version: "{% if ansible_facts.os_family == 'Redhat' and ansible_facts.distribution_major_version == '8' %}24*{% else %}present{% endif %}" diff --git a/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml b/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml index 808e48ee..61312076 100644 --- a/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml +++ b/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml @@ -42,3 +42,16 @@ delay: 3 until: _eltask is succeeded tags: rabbitmq + when: erlang_version == "present" + +- name: Install pinned erlang package on {{ ansible_facts.distribution }} + become: yes + package: + name: erlang-{{ erlang_version }} + state: present + register: _eltask + retries: 5 + delay: 3 + until: _eltask is succeeded + tags: rabbitmq + when: erlang_version != "present"