suse: switch to using upstream repos

This patch makes SUSE use the upstream repos for RabbitMQ and
the devel:languages:erlang:Factory for Erlang.

As all distros are using rabbit 3.8 we can drop checking
3.7 style cluster_status output.

Change-Id: Ifaba2611f987e4e135b7a28db6c6053ef63b0913
This commit is contained in:
Mohammed Naser 2019-06-11 17:13:32 -04:00 committed by Dmitriy Rabotyagov
parent fe71d5b536
commit 246ff262e5
3 changed files with 37 additions and 46 deletions

View File

@ -13,48 +13,28 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Fail if installation method is not 'distro' - name: Fail if installation method is not 'external_repo'
fail: fail:
msg: "The only supported rabbitmq_install_method for openSUSE is 'distro'." msg: "The only supported rabbitmq_install_method for openSUSE is 'external_repo'."
when: rabbitmq_install_method != 'distro' when: rabbitmq_install_method != 'external_repo'
- block: - name: Configure repositories
- name: Install the RabbitMQ package zypper_repository:
zypper: name: "{{ item.name }}"
name: "{{ rabbitmq_distro_packages }}" description: "{{ item.description }}"
state: "{{ rabbitmq_package_state }}" repo: "{{ item.baseurl }}"
register: install_rabbitmq disable_gpg_check: "{{ item.gpgcheck | default('yes') }}"
rescue: with_items:
- name: Install the RabbitMQ package (force) - "{{ rabbitmq_erlang_repo }}"
package: - "{{ rabbitmq_repo }}"
name: "{{ rabbitmq_distro_packages }}" tags:
state: "{{ rabbitmq_package_state }}" - rabbitmq-repos
force: yes
register: install_rabbitmq - name: Install RabbitMQ packages
zypper:
name: "{{ rabbitmq_distro_packages }}"
state: "{{ rabbitmq_package_state }}"
register: install_rabbitmq
tags: tags:
- rabbitmq-package-rpm - rabbitmq-package-rpm
- rabbitmq-zypper-packages - rabbitmq-zypper-packages
# NOTE(hwoarang) on openSUSE, rabbitmq-server depends on epmd.service which
# depends on epmd.socket which runs on localhost. It is just easier to let
# the rabbitmq-server launch epmd directly since we are inside a container.
- name: Add rabbitmq-server systemd service (SUSE)
template:
src: "rabbitmq-server.service.j2"
dest: "/etc/systemd/system/rabbitmq-server.service"
register: rabbitmq_server_service_added
# NOTE(hwoarang) Normally, this task should only be executed when
# rabbitmq_install_method == 'distro'. However, the upstream package
# does not contain a systemd file and as such we need to provide one.
# This should be reverted once https://github.com/rabbitmq/rabbitmq-server-release/pull/31
# is merged and new builds of rabbimq-server are available.
tags:
- rabbitmq-config
- name: Reload the systemd daemon
systemd:
daemon_reload: yes
when:
- rabbitmq_server_service_added is changed
tags:
- rabbitmq-config

View File

@ -26,8 +26,7 @@
# Our solution to get the cluster name out cleanly is inspired by # Our solution to get the cluster name out cleanly is inspired by
# https://unix.stackexchange.com/a/13472 # https://unix.stackexchange.com/a/13472
- name: Get rabbitmq cluster name - name: Get rabbitmq cluster name
shell: | shell: rabbitmqctl -q cluster_status | sed 's/ //g' | grep -oP '(?<=Clustername:).*'
rabbitmqctl -q cluster_status | sed 's/ //g' | grep -oP '{{ _rabbitmq_release_version is version('3.8.0', '<') | ternary('(?<={cluster_name,<<").*(?=">>})', '(?<=Clustername:).*') }}'
args: args:
executable: /bin/bash executable: /bin/bash
changed_when: false changed_when: false

View File

@ -13,11 +13,23 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
_rabbitmq_install_method: distro _rabbitmq_install_method: external_repo
_rabbitmq_package_version: 3.7.19 _rabbitmq_repo_url: "https://packagecloud.io/rabbitmq/rabbitmq-server/opensuse/{{ ansible_distribution_version }}/$basearch"
_rabbitmq_repo:
name: rabbitmq_rabbitmq-server
description: "RabbitMQ Server Rolling Repository"
baseurl: "{{ rabbitmq_repo_url }}"
_rabbitmq_erlang_repo_url: "https://download.opensuse.org/repositories/devel:languages:erlang:Factory/openSUSE_Leap_{{ ansible_distribution_version }}/"
_rabbitmq_erlang_repo:
name: devel_languages_erlang_Factory
description: "erlang devel project for Factory"
baseurl: "{{ rabbitmq_erlang_repo_url }}"
_rabbitmq_package_version: 3.8.0-1
_rabbitmq_release_version: "{{ rabbitmq_package_version }}" _rabbitmq_release_version: "{{ rabbitmq_package_version }}"
rabbitmq_distro_packages: rabbitmq_distro_packages:
- "rabbitmq-server={{ rabbitmq_package_version }}" - erlang-22.1.5-lp151.1.1.x86_64
- rabbitmq-server-plugins - "rabbitmq-server-{{ _rabbitmq_package_version }}.suse.noarch"