Commit 4f6b565a by Kevin Falcone

Fixups to use their alternate rabbit PPA

parent 8e92b6f1
FROM edxops/precise-common
FROM edxops/xenial-common:latest
MAINTAINER edxops
ADD . /edx/app/edx_ansible/edx_ansible
......
......@@ -44,7 +44,7 @@ RABBITMQ_CLUSTERED_HOSTS: []
# https://www.rabbitmq.com/production-checklist.html
RABBITMQ_VM_MEMORY_HIGH_WATERMARK: 0.4
RABBITMQ_VERSION: 3.6.6-1
RABBITMQ_VERSION: 3.6.9-1
# Internal role variables below this line
......@@ -52,22 +52,11 @@ RABBITMQ_VERSION: 3.6.6-1
rabbitmq_refresh: false
extra_repos:
- {repo: "deb https://www.rabbitmq.com/debian/ testing main", key: "https://www.rabbitmq.com/rabbitmq-signing-key-public.asc"}
- {repo: "deb https://packages.erlang-solutions.com/ubuntu precise contrib", key: "https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc"}
# - {repo: "deb https://www.rabbitmq.com/debian/ testing main", key: "https://www.rabbitmq.com/rabbitmq-signing-key-public.asc"}
- {repo: "deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ {{ ansible_distribution_release }} main", key: "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey " }
# We mirror the deb package for rabbitmq-server because
# nodes need to be running the same version
rabbitmq_pkg_url: "https://files.edx.org/rabbitmq_packages/rabbitmq-server_{{ RABBITMQ_VERSION }}_all.deb"
rabbitmq_pkg: "rabbitmq-server"
rabbitmq_debian_pkgs:
# why is is this needed?
- python-software-properties
# erlang dependencies for rabbitmq
- erlang
- erlang-nox
# for installing the deb package with
# dependencies
- gdebi
- "apt-transport-https"
rabbitmq_config_dir: "/etc/rabbitmq"
rabbitmq_cookie_dir: "/var/lib/rabbitmq"
......
......@@ -2,6 +2,18 @@
# It is recommended that this role be played with serial set to 1 because
# There is a bug with initializing multiple nodes in the HA cluster at once
# http://rabbitmq.1065348.n5.nabble.com/Rabbitmq-boot-failure-with-quot-tables-not-present-quot-td24494.html
#
- name: install packages needed by rabbit
apt:
name: "{{ item }}"
state: present
install_recommends: yes
force: yes
update_cache: yes
with_items: "{{ rabbitmq_debian_pkgs }}"
tags:
- install
- install:app-requirements
- name: trust extra repositories
apt_key:
......@@ -14,18 +26,7 @@
repo: "{{ item.repo }}"
state: present
update_cache: yes
with_items: extra_repos
- name: install python-software-properties if debian
apt:
name: "{{ item }}"
state: present
with_items: "{{ rabbitmq_debian_pkgs }}"
- name: Fetch the rabbitmq server deb
get_url:
url: "{{ rabbitmq_pkg_url }}"
dest: "/var/tmp/{{ rabbitmq_pkg_url|basename }}"
with_items: "{{ extra_repos }}"
# If we don't set pipefail first, `||` will be looking at the exit code of the last command in the pipe
- name: Check if rabbit is installed
......@@ -40,10 +41,12 @@
fail: Expected rabbitmq version {{ RABBITMQ_VERSION }}, found {{ installed_version.stdout }}
when: CHECK_RABBIT_VERSION and installed_version.stdout is defined and installed_version.stdout not in [RABBITMQ_VERSION, 'not installed']
- name: Install rabbit package using gdebi
shell: "gdebi --n {{ rabbitmq_pkg_url|basename }}"
args:
chdir: /var/tmp
- name: Install rabbit package
apt:
name: "rabbitmq-server={{ RABBITMQ_VERSION }}"
state: present
force: yes
update_cache: yes
when: installed_version.stdout is defined and installed_version.stdout == "not installed"
- name: Stop rabbit cluster
......@@ -214,9 +217,16 @@
- maintenance
- name: Make queues mirrored
shell: "/usr/sbin/rabbitmqctl -p {{ item }} set_policy HA \"\" '{\"ha-mode\":\"all\",\"ha-sync-mode\":\"automatic\"}'"
when: RABBITMQ_CLUSTERED_HOSTS|length > 1
rabbitmq_policy:
name: HA
pattern: .*
vhost: "{{ item }}"
args:
tags:
ha-mode: all
ha-sync-mode: automatic
with_items: "{{ RABBITMQ_VHOSTS }}"
when: RABBITMQ_CLUSTERED_HOSTS|length > 1
tags:
- ha
- maintenance
......@@ -228,10 +238,6 @@
get_url:
url: "http://localhost:{{ rabbitmq_management_port }}/cli/rabbitmqadmin"
dest: "/usr/local/bin/rabbitmqadmin"
- name: Ensure rabbitmqadmin attributes
file:
path: "/usr/local/bin/rabbitmqadmin"
owner: root
group: root
mode: "0655"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment