From 372ccd1bbdbe63ad35a200afab55bb91c4c016da Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 4 Jun 2018 14:51:05 -0500 Subject: [PATCH] Update the version of erlang to support rabbitmq The version of erlang we're using, while functional, is not recommended. This change updates our version of erlang for rabbitmq to be the recommended version by changing the pinned version of erlang. The apt package pinning meta dependency has been removed and put into the apt task file as an include role. To ensure a more uniform process for setting the version of erlang used with rabbitmq the new variable `rabbitmq_erlang_version_spec` has been added. This option has a default of "null" and is set by distro specific variables when applicable. Erlang version support matrix: https://www.rabbitmq.com/which-erlang.html Change-Id: Iced12d4533eec068bd11d8bd235d81308ef40427 Signed-off-by: Kevin Carter --- defaults/main.yml | 3 +++ meta/main.yml | 13 +------------ .../notes/elang-version-2c1135466ef94032.yaml | 9 +++++++++ tasks/install_apt.yml | 14 ++++++++++++++ tasks/install_yum.yml | 6 ++++-- tests/ansible-role-requirements.yml | 2 +- tests/rabbitmq_server-upgrade-overrides.yml | 7 +++++++ tox.ini | 2 +- vars/debian.yml | 2 ++ vars/redhat.yml | 2 ++ 10 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/elang-version-2c1135466ef94032.yaml create mode 100644 tests/rabbitmq_server-upgrade-overrides.yml diff --git a/defaults/main.yml b/defaults/main.yml index 353f5fd7..dd448159 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -53,6 +53,9 @@ rabbitmq_erlang_repo_url: "{{ _rabbitmq_erlang_repo_url }}" # Set the repo information for the Erlang repository rabbitmq_erlang_repo: "{{ _rabbitmq_erlang_repo }}" +# Set the elang version used on the deployment +rabbitmq_erlang_version_spec: "{{ _rabbitmq_erlang_version_spec | default(null) }}" + # Choose file, distro, external_repo for rabbitmq_install_method. rabbitmq_install_method: "{{ _rabbitmq_install_method }}" diff --git a/meta/main.yml b/meta/main.yml index ef6d38f6..bb027f0b 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -36,15 +36,4 @@ galaxy_info: - rabbitmq - development - openstack -dependencies: - - role: apt_package_pinning - apt_package_pinning_file_name: "rabbitmq.pref" - apt_package_pinning_priority: 999 - apt_pinned_packages: - - package: "*" - release: "Erlang Solutions Ltd." - - package: "erlang*" - version: "1:19.3*" - priority: 1000 - when: - - ansible_pkg_mgr == 'apt' +dependencies: [] diff --git a/releasenotes/notes/elang-version-2c1135466ef94032.yaml b/releasenotes/notes/elang-version-2c1135466ef94032.yaml new file mode 100644 index 00000000..5afeb0a3 --- /dev/null +++ b/releasenotes/notes/elang-version-2c1135466ef94032.yaml @@ -0,0 +1,9 @@ +--- +features: + - The option ``rabbitmq_erlang_version_spec`` has been added allowing + deployers to set the version of erlang used on a given installation. +deprecations: + - The use of the ``apt_package_pinning`` role as a meta dependency + has been removed from the rabbitmq_server role. While the package + pinning role is still used, it will now only be executed when the + apt task file is executed. diff --git a/tasks/install_apt.yml b/tasks/install_apt.yml index dca3c2b4..21687a79 100644 --- a/tasks/install_apt.yml +++ b/tasks/install_apt.yml @@ -13,6 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Run the apt package pinning role + include_role: + name: apt_package_pinning + private: true + vars: + apt_package_pinning_file_name: "rabbitmq.pref" + apt_package_pinning_priority: 999 + apt_pinned_packages: + - package: "*" + release: "Erlang Solutions Ltd." + - package: "erlang*" + version: "{{ rabbitmq_erlang_version_spec }}" + priority: 1000 + - block: - name: Add rabbitmq apt-keys apt_key: diff --git a/tasks/install_yum.yml b/tasks/install_yum.yml index 08780dd2..d346e0a5 100644 --- a/tasks/install_yum.yml +++ b/tasks/install_yum.yml @@ -113,8 +113,10 @@ when: - item.pkg_spec not in yum_versionlock_list.stdout with_items: - - { 'pkg_name': 'erlang', 'pkg_spec': "erlang-19*" } - - { 'pkg_name': 'rabbitmq-server', 'pkg_spec': "rabbitmq-server-{{ rabbitmq_release_version }}*" } + - pkg_name: 'erlang' + pkg_spec: "{{ rabbitmq_erlang_version_spec }}" + - pkg_name: 'rabbitmq-server' + pkg_spec: "rabbitmq-server-{{ rabbitmq_release_version }}*" tags: - rabbitmq-yum-packages diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index 5851c335..b6dbe377 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -21,4 +21,4 @@ - name: previous_rabbitmq_server src: https://git.openstack.org/openstack/openstack-ansible-rabbitmq_server scm: git - version: stable/pike + version: stable/queens diff --git a/tests/rabbitmq_server-upgrade-overrides.yml b/tests/rabbitmq_server-upgrade-overrides.yml new file mode 100644 index 00000000..657ad9e6 --- /dev/null +++ b/tests/rabbitmq_server-upgrade-overrides.yml @@ -0,0 +1,7 @@ +rabbitmq_cookie_token: secrete +rabbitmq_ssl_cert: /etc/rabbitmq/rabbitmq.pem +rabbitmq_ssl_key: /etc/rabbitmq/rabbitmq.key + +rabbitmq_hipe_compile: True + +rabbitmq_erlang_version_spec: "{{ (ansible_pkg_mgr == 'apt') | ternary('1:19.3*','erlang-19*') }}" diff --git a/tox.ini b/tox.ini index 262793f6..d4659e3b 100644 --- a/tox.ini +++ b/tox.ini @@ -106,7 +106,7 @@ deps = {[testenv:ansible]deps} setenv = {[testenv]setenv} - ANSIBLE_OVERRIDES={toxinidir}/tests/rabbitmq_server-overrides.yml + ANSIBLE_OVERRIDES={toxinidir}/tests/rabbitmq_server-upgrade-overrides.yml CLONE_UPGRADE_TESTS=yes commands = bash -c "{toxinidir}/tests/test-rabbitmq-upgrades.sh" diff --git a/vars/debian.yml b/vars/debian.yml index e9cbe2ff..5eb2725f 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -42,6 +42,8 @@ _rabbitmq_erlang_repo: state: "present" filename: els_erlang +_rabbitmq_erlang_version_spec: "1:20.1*" + rabbitmq_dependencies: - erlang-base-hipe - erlang-nox diff --git a/vars/redhat.yml b/vars/redhat.yml index 9c4d0547..a9c33eb5 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -46,6 +46,8 @@ _rabbitmq_erlang_repo: state: "present" filename: els-erlang +_rabbitmq_erlang_version_spec: "erlang-20.1*" + rabbitmq_distro_packages: - openssl - rabbitmq-server