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 MAINTAINER edxops
ADD . /edx/app/edx_ansible/edx_ansible ADD . /edx/app/edx_ansible/edx_ansible
......
...@@ -44,7 +44,7 @@ RABBITMQ_CLUSTERED_HOSTS: [] ...@@ -44,7 +44,7 @@ RABBITMQ_CLUSTERED_HOSTS: []
# https://www.rabbitmq.com/production-checklist.html # https://www.rabbitmq.com/production-checklist.html
RABBITMQ_VM_MEMORY_HIGH_WATERMARK: 0.4 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 # Internal role variables below this line
...@@ -52,22 +52,11 @@ RABBITMQ_VERSION: 3.6.6-1 ...@@ -52,22 +52,11 @@ RABBITMQ_VERSION: 3.6.6-1
rabbitmq_refresh: false rabbitmq_refresh: false
extra_repos: extra_repos:
- {repo: "deb https://www.rabbitmq.com/debian/ testing main", key: "https://www.rabbitmq.com/rabbitmq-signing-key-public.asc"} # - {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://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: rabbitmq_debian_pkgs:
# why is is this needed? - "apt-transport-https"
- python-software-properties
# erlang dependencies for rabbitmq
- erlang
- erlang-nox
# for installing the deb package with
# dependencies
- gdebi
rabbitmq_config_dir: "/etc/rabbitmq" rabbitmq_config_dir: "/etc/rabbitmq"
rabbitmq_cookie_dir: "/var/lib/rabbitmq" rabbitmq_cookie_dir: "/var/lib/rabbitmq"
......
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
# It is recommended that this role be played with serial set to 1 because # 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 # 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 # 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 - name: trust extra repositories
apt_key: apt_key:
...@@ -14,18 +26,7 @@ ...@@ -14,18 +26,7 @@
repo: "{{ item.repo }}" repo: "{{ item.repo }}"
state: present state: present
update_cache: yes update_cache: yes
with_items: extra_repos 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 }}"
# If we don't set pipefail first, `||` will be looking at the exit code of the last command in the pipe # 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 - name: Check if rabbit is installed
...@@ -40,10 +41,12 @@ ...@@ -40,10 +41,12 @@
fail: Expected rabbitmq version {{ RABBITMQ_VERSION }}, found {{ installed_version.stdout }} 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'] 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 - name: Install rabbit package
shell: "gdebi --n {{ rabbitmq_pkg_url|basename }}" apt:
args: name: "rabbitmq-server={{ RABBITMQ_VERSION }}"
chdir: /var/tmp state: present
force: yes
update_cache: yes
when: installed_version.stdout is defined and installed_version.stdout == "not installed" when: installed_version.stdout is defined and installed_version.stdout == "not installed"
- name: Stop rabbit cluster - name: Stop rabbit cluster
...@@ -214,9 +217,16 @@ ...@@ -214,9 +217,16 @@
- maintenance - maintenance
- name: Make queues mirrored - name: Make queues mirrored
shell: "/usr/sbin/rabbitmqctl -p {{ item }} set_policy HA \"\" '{\"ha-mode\":\"all\",\"ha-sync-mode\":\"automatic\"}'" rabbitmq_policy:
when: RABBITMQ_CLUSTERED_HOSTS|length > 1 name: HA
pattern: .*
vhost: "{{ item }}"
args:
tags:
ha-mode: all
ha-sync-mode: automatic
with_items: "{{ RABBITMQ_VHOSTS }}" with_items: "{{ RABBITMQ_VHOSTS }}"
when: RABBITMQ_CLUSTERED_HOSTS|length > 1
tags: tags:
- ha - ha
- maintenance - maintenance
...@@ -228,10 +238,6 @@ ...@@ -228,10 +238,6 @@
get_url: get_url:
url: "http://localhost:{{ rabbitmq_management_port }}/cli/rabbitmqadmin" url: "http://localhost:{{ rabbitmq_management_port }}/cli/rabbitmqadmin"
dest: "/usr/local/bin/rabbitmqadmin" dest: "/usr/local/bin/rabbitmqadmin"
- name: Ensure rabbitmqadmin attributes
file:
path: "/usr/local/bin/rabbitmqadmin"
owner: root owner: root
group: root group: root
mode: "0655" 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