Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Rabbitmq v3.8.9 #2085

Merged
merged 8 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [#1965](https://github.com/epiphany-platform/epiphany/issues/1965) - Upgrade Elasticsearch Curator to v5.8.3
- [#1927](https://github.com/epiphany-platform/epiphany/issues/1927) - Upgrade Zookeeper to v3.5.8
- [#1921](https://github.com/epiphany-platform/epiphany/issues/1921) - Upgrade Kafka to v2.6.0
- [#1934](https://github.com/epiphany-platform/epiphany/issues/1934) - Upgrade Rabbitmq to v3.8.9

## [0.7.2] 2020-10-07

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
cookie_file: /var/lib/rabbitmq/.erlang.cookie
# check RabbitMQ/Erlang version compatibility matrix before modification
versions:
general: 3.8.9 # required for upgrade
atsikham marked this conversation as resolved.
Show resolved Hide resolved
# packages
debian:
erlang: 1:23.1.*
rabbitmq: 3.8.9*
redhat:
erlang: 23.1.*
rabbitmq: 3.8.9
rpudlowski93 marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
- name: Add RabbitMQ policies
- name: Add policies
rabbitmq_policy:
name: "{{ item.name }}"
pattern: "{{ item.pattern }}"
tags: "{{ item.definitions }}"
state: present
loop: "{{ specification.rabbitmq_policies }}"
when: groups['rabbitmq'][0] == inventory_hostname
Original file line number Diff line number Diff line change
@@ -1,52 +1,49 @@
---
- name: Set variable with SSL/TLS to enabled false
set_fact: is_ssl_enabled="false"
changed_when: false

- name: Check if variable with SSL/TLS should be set to true
set_fact: is_ssl_enabled="{{ specification.custom_configurations | selectattr('name','equalto','listeners.ssl.default') | list | length > 0 }}"
changed_when: false
when: specification.custom_configurations | length > 0

- name: rabbitmq default file
- name: Copy rabbitmq.conf file
template:
src: rabbitmq-server.j2
dest: /etc/rabbitmq/rabbitmq.conf
owner: root
group: root
mode: 0644
register: config_changed
mode: u=rw,go=r
register: config_file_stat
atsikham marked this conversation as resolved.
Show resolved Hide resolved

- name: default settings for RabbitMQ AMQP server
- name: Copy rabbitmq-env.conf file
template:
src: rabbitmq-env.conf.j2
dest: /etc/rabbitmq/rabbitmq-env.conf
owner: root
group: root
mode: 0644
register: env_settings_changed
mode: u=rw,go=r
register: env_file_stat

- name: Symlink RabbitMQ bin to sbin(for install plugins)
- name: Symlink bin to sbin (for plugins installation)
file:
src: /usr/lib/rabbitmq/bin
dest: /usr/lib/rabbitmq/sbin
state: link

- name: Enable plugins that were installed
when: specification.rabbitmq_plugins
rabbitmq_plugin:
names: "{{ item }}"
names: "{{ specification.rabbitmq_plugins | join(',') }}"
prefix: /usr/lib/rabbitmq
state: enabled
new_only: no
with_items: "{{ specification.rabbitmq_plugins }}"
new_only: true
register: rabbitmq_plugins

- name: Restart RabbitMQ
service: name=rabbitmq-server state=restarted
- name: Restart service
when:
- config_changed.changed or env_settings_changed.changed
- not is_ssl_enabled
- config_file_stat.changed or env_file_stat.changed or rabbitmq_plugins.changed
- not (specification.stop_service | bool)
service:
name: rabbitmq-server
enabled: true
state: restarted
rpudlowski93 marked this conversation as resolved.
Show resolved Hide resolved

- name: Stop RabbitMQ for manual certificates configuration
service: name=rabbitmq-server state=stopped
when:
- is_ssl_enabled
- name: Stop service for manual configuration of certificates
when: specification.stop_service | bool
service:
name: rabbitmq-server
enabled: false
state: stopped

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
- name: Install packages
apt:
name:
- logrotate

- erlang-eldap={{ versions.debian.erlang }}
- erlang-inets={{ versions.debian.erlang }}
- erlang-os-mon={{ versions.debian.erlang }}
- erlang-public-key={{ versions.debian.erlang }}
- erlang-ssl={{ versions.debian.erlang }}

# Additional dependencies required to fix https://github.com/epiphany-platform/epiphany/issues/1920
- erlang-asn1={{ versions.debian.erlang }}
- erlang-base-hipe={{ versions.debian.erlang }}
- erlang-crypto={{ versions.debian.erlang }}
- erlang-ftp={{ versions.debian.erlang }}
- erlang-mnesia={{ versions.debian.erlang }}
- erlang-parsetools={{ versions.debian.erlang }}
- erlang-runtime-tools={{ versions.debian.erlang }}
- erlang-snmp={{ versions.debian.erlang }}
- erlang-syntax-tools={{ versions.debian.erlang }}
- erlang-tftp={{ versions.debian.erlang }}
- erlang-tools={{ versions.debian.erlang }}
- erlang-xmerl={{ versions.debian.erlang }}

- rabbitmq-server={{ versions.debian.rabbitmq }}
update_cache: true
state: present
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Install packages
yum:
name:
- logrotate
- erlang-{{ versions.redhat.erlang }}
- rabbitmq-server-{{ versions.redhat.rabbitmq }}
update_cache: true
state: present
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
---
- name: Retrieve RabbitMQ master
set_fact:
rabbitmq_master: "{{ groups['rabbitmq'][0] }}"

- name: Stop rabbitmq
become: yes
- name: Stop application
command: rabbitmqctl stop_app
when: rabbitmq_master != inventory_hostname

- name: Add node to cluster
become: yes
command: rabbitmqctl join_cluster rabbit@{{ rabbitmq_master.split('.')[0] }}
when: rabbitmq_master != inventory_hostname

- name: Start rabbitmq
become: yes
command: rabbitmqctl start_app
- name: Start application
command: rabbitmqctl start_app
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
---
- include_tasks: "set-variables.yml"
- name: Set rabbitmq_master fact
set_fact:
rabbitmq_master: "{{ groups['rabbitmq'][0] }}"

- include_tasks: "{{ ansible_os_family }}.yml"
- include_tasks: "install-packages-{{ ansible_os_family | lower }}.yml"

# NOTE: rabbitmqctl start_app, stop_app, join_cluster commands do NOT work when rabbitmq server instance is down
- name: Ensure rabbitmq-server service is running
service:
name: rabbitmq-server
enabled: true
state: started
when:
- not (specification.stop_service | bool)

- include_tasks: "set-erlang-cookie.yml"
when: is_clustered and groups['rabbitmq'] | length > 1
when:
- specification.cluster.is_clustered | bool
- inventory_hostname == rabbitmq_master

- name: Set erlang_cookie fact for nodes
when:
- specification.cluster.is_clustered | bool
- inventory_hostname != rabbitmq_master
set_fact:
erlang_cookie: "{{ hostvars[rabbitmq_master]['erlang_cookie'] }}"

# Cookie is updated on master in previous step
- include_tasks: "update-erlang-cookie.yml"
when:
- specification.cluster.is_clustered | bool
- inventory_hostname != rabbitmq_master

- include_tasks: "configure-rabbitmq.yml"

- include_tasks: "enable-and-start-service.yml"

- include_tasks: "set-logrotate.yml"

- include_tasks: "set-ulimits.yml"

# Skip any configuration when service is stopped
- include_tasks: "join-cluster.yml"
when: is_clustered and groups['rabbitmq'] | length > 1
when:
- specification.cluster.is_clustered | bool
- inventory_hostname != rabbitmq_master
- not (specification.stop_service | bool)

- include_tasks: "configure-policies.yml"
when:
- not (specification.stop_service | bool)
- inventory_hostname == rabbitmq_master
Loading