From 14ae11eaa2ff0abcf42c58e9ace50d640b7d962e Mon Sep 17 00:00:00 2001 From: amanda Date: Thu, 19 May 2022 15:37:28 +0100 Subject: [PATCH 1/3] Allow Erlang version on EL8 to be pinned, and by default use < 25 --- roles/StackStorm.rabbitmq/defaults/main.yml | 2 ++ roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/roles/StackStorm.rabbitmq/defaults/main.yml b/roles/StackStorm.rabbitmq/defaults/main.yml index 09f572f5..9f2909bc 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_el8_version: "24*" diff --git a/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml b/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml index 808e48ee..c7a2c781 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_el8_version == "present" + +- name: Install pinned erlang package on {{ ansible_facts.distribution }} + become: yes + package: + name: erlang-{{erlang_el8_version}} + state: present + register: _eltask + retries: 5 + delay: 3 + until: _eltask is succeeded + tags: rabbitmq + when: erlang_el8_version != "present" From 3808b2567a95759d57505a88098c8f843dcd3f40 Mon Sep 17 00:00:00 2001 From: amanda Date: Thu, 19 May 2022 15:42:27 +0100 Subject: [PATCH 2/3] Fix lint check --- roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml b/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml index c7a2c781..1e21b8b7 100644 --- a/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml +++ b/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml @@ -47,7 +47,7 @@ - name: Install pinned erlang package on {{ ansible_facts.distribution }} become: yes package: - name: erlang-{{erlang_el8_version}} + name: erlang-{{ erlang_el8_version }} state: present register: _eltask retries: 5 From 5be4ddf97ece31cfb18ce6c8bc381d572c97c7b4 Mon Sep 17 00:00:00 2001 From: amanda Date: Thu, 19 May 2022 15:58:09 +0100 Subject: [PATCH 3/3] erlang version configurable for all EL releases --- roles/StackStorm.rabbitmq/defaults/main.yml | 2 +- roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/StackStorm.rabbitmq/defaults/main.yml b/roles/StackStorm.rabbitmq/defaults/main.yml index 9f2909bc..e5308236 100644 --- a/roles/StackStorm.rabbitmq/defaults/main.yml +++ b/roles/StackStorm.rabbitmq/defaults/main.yml @@ -6,4 +6,4 @@ rabbitmq_plugins: [] # Set to "present" to install latest version, or specify specific version rabbitmq_version: "present" # Use version or wildcard -erlang_el8_version: "24*" +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 1e21b8b7..61312076 100644 --- a/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml +++ b/roles/StackStorm.rabbitmq/tasks/rabbitmq_redhat.yml @@ -42,16 +42,16 @@ delay: 3 until: _eltask is succeeded tags: rabbitmq - when: erlang_el8_version == "present" + when: erlang_version == "present" - name: Install pinned erlang package on {{ ansible_facts.distribution }} become: yes package: - name: erlang-{{ erlang_el8_version }} + name: erlang-{{ erlang_version }} state: present register: _eltask retries: 5 delay: 3 until: _eltask is succeeded tags: rabbitmq - when: erlang_el8_version != "present" + when: erlang_version != "present"