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:
parent
fe71d5b536
commit
246ff262e5
@ -13,48 +13,28 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Fail if installation method is not 'distro'
|
||||
- name: Fail if installation method is not 'external_repo'
|
||||
fail:
|
||||
msg: "The only supported rabbitmq_install_method for openSUSE is 'distro'."
|
||||
when: rabbitmq_install_method != 'distro'
|
||||
msg: "The only supported rabbitmq_install_method for openSUSE is 'external_repo'."
|
||||
when: rabbitmq_install_method != 'external_repo'
|
||||
|
||||
- block:
|
||||
- name: Install the RabbitMQ package
|
||||
zypper:
|
||||
name: "{{ rabbitmq_distro_packages }}"
|
||||
state: "{{ rabbitmq_package_state }}"
|
||||
register: install_rabbitmq
|
||||
rescue:
|
||||
- name: Install the RabbitMQ package (force)
|
||||
package:
|
||||
name: "{{ rabbitmq_distro_packages }}"
|
||||
state: "{{ rabbitmq_package_state }}"
|
||||
force: yes
|
||||
register: install_rabbitmq
|
||||
- name: Configure repositories
|
||||
zypper_repository:
|
||||
name: "{{ item.name }}"
|
||||
description: "{{ item.description }}"
|
||||
repo: "{{ item.baseurl }}"
|
||||
disable_gpg_check: "{{ item.gpgcheck | default('yes') }}"
|
||||
with_items:
|
||||
- "{{ rabbitmq_erlang_repo }}"
|
||||
- "{{ rabbitmq_repo }}"
|
||||
tags:
|
||||
- rabbitmq-repos
|
||||
|
||||
- name: Install RabbitMQ packages
|
||||
zypper:
|
||||
name: "{{ rabbitmq_distro_packages }}"
|
||||
state: "{{ rabbitmq_package_state }}"
|
||||
register: install_rabbitmq
|
||||
tags:
|
||||
- rabbitmq-package-rpm
|
||||
- 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
|
||||
|
@ -26,8 +26,7 @@
|
||||
# Our solution to get the cluster name out cleanly is inspired by
|
||||
# https://unix.stackexchange.com/a/13472
|
||||
- name: Get rabbitmq cluster name
|
||||
shell: |
|
||||
rabbitmqctl -q cluster_status | sed 's/ //g' | grep -oP '{{ _rabbitmq_release_version is version('3.8.0', '<') | ternary('(?<={cluster_name,<<").*(?=">>})', '(?<=Clustername:).*') }}'
|
||||
shell: rabbitmqctl -q cluster_status | sed 's/ //g' | grep -oP '(?<=Clustername:).*'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
changed_when: false
|
||||
|
@ -13,11 +13,23 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# 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_distro_packages:
|
||||
- "rabbitmq-server={{ rabbitmq_package_version }}"
|
||||
- rabbitmq-server-plugins
|
||||
- erlang-22.1.5-lp151.1.1.x86_64
|
||||
- "rabbitmq-server-{{ _rabbitmq_package_version }}.suse.noarch"
|
||||
|
Loading…
Reference in New Issue
Block a user