RedHat: Use the distribution package

The RDO repository provids a rabbitmq-server which is tested by the
RDO team so we should use that instead of the external one. We also
skip several tasks which add gpg keys and external repositories
since none of these steps is necessary when we install packages
from the distro repos.

Change-Id: I7c0a988f3aab14042ac2491b1021e789ba9ef4b3
This commit is contained in:
Markos Chandras 2018-09-20 16:17:02 +01:00
parent 7a7033e12b
commit ff6f7c8e01
2 changed files with 29 additions and 1 deletions

View File

@ -41,6 +41,8 @@
tags:
- rabbitmq-gpg-keys
when: rabbitmq_install_method != 'distro'
- name: Install RabbitMQ yum mirror
yum_repository:
name: "{{ rabbitmq_repo.name }}"
@ -81,6 +83,8 @@
--enable {{ item.name }}
--setopt="{{ item.name }}.priority={{ item.priority }}"
changed_when: false
when:
- rabbitmq_install_method != 'distro'
with_items:
- name: "{{ rabbitmq_repo.name }}"
priority: 40
@ -132,3 +136,27 @@
tags:
- rabbitmq-package-rpm
- rabbitmq-yum-packages
# NOTE(hwoarang) on RedHat, 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 (RedHat)
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

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_rabbitmq_install_method: external_repo
_rabbitmq_install_method: distro
_rabbitmq_package_url: "https://packagecloud.io/rabbitmq/rabbitmq-server/packages/el/7/rabbitmq-server-3.7.5-1.el7.noarch.rpm/download.rpm"
_rabbitmq_package_version: "{{ rabbitmq_package_url.split('/')[-2].rsplit('.', 1)[0] }}"
_rabbitmq_release_version: "{{ rabbitmq_package_version.split('-')[2] }}"