Skip to content

Commit

Permalink
Update integration test role setup_rabbitmq
Browse files Browse the repository at this point in the history
New process as documented upstream.

Follows the general outline developed in ansible-collections#75
  • Loading branch information
cognifloyd committed Jul 31, 2021
1 parent 137d098 commit 92095ee
Showing 1 changed file with 65 additions and 29 deletions.
94 changes: 65 additions & 29 deletions tests/integration/targets/setup_rabbitmq/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,89 @@
---
# https://www.rabbitmq.com/install-debian.html#apt-pinning
- name: Pin erlang version that rabbitmq supports
copy:
dest: /etc/apt/preferences.d/erlang
content: |
Package: erlang*
Pin: version 1:20.3.8.18-1
Pin-Priority: 1000
Package: esl-erlang
Pin: version 1:20.3.6
Pin-Priority: 1000
# https://stackoverflow.com/questions/25193161/chfn-pam-system-error-intermittently-in-docker-hub-builds/25267015
- name: Disable chfn
file:
path: /usr/bin/chfn
src: /bin/true
state: link
force: yes

- name: Install https transport for apt
# https://www.rabbitmq.com/install-debian.html#apt-pinning
- name: Install Essential Dependencies
apt:
name: apt-transport-https
state: latest
name:
- gnupg
- debian-keyring
- debian-archive-keyring
- apt-transport-https
- python3-apt
# Required by the rabbitmq modules that uses the management API
- python3-requests
state: present
force: yes

- name: Add RabbitMQ release signing key
- name: Add RabbitMQ main release signing key
apt_key:
url: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_rabbitmq/rabbitmq-release-signing-key.asc
keyserver: "hkps://keys.openpgp.org"
id: "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
state: present
# The key for RPM release signing is different than this one.
# These URIs each have the same *RPM* signing key:
# "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc"
# "https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_rabbitmq/rabbitmq-release-signing-key.asc"

- name: Add RabbitMQ repository signing key
apt_key:
url: "{{ item }}"
state: present
loop:
# Cloudsmith: modern Erlang repository
- "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key"
# Cloudsmith: RabbitMQ repository
- "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key"

- name: Add RabbitMQ Erlang repository
apt_repository:
repo: ppa:rabbitmq/rabbitmq-erlang
repo: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu {{ ansible_facts.distribution_release }} main"
filename: 'rabbitmq-erlang'
state: present
update_cache: yes

# Required by the rabbitmq modules that uses the management API
- name: Add RabbitMQ Server repository
apt_repository:
repo: "deb https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu {{ ansible_facts.distribution_release }} main"
filename: 'rabbitmq-server'
state: present
update_cache: yes

- name: Install requests
pip:
name: requests

- name: Install RabbitMQ Server
- name: Install RabbitMQ Erlang dependencies
apt:
deb: https://ansible-ci-files.s3.us-east-1.amazonaws.com/test/integration/targets/setup_rabbitmq/rabbitmq-server_3.8.14-1_all.deb
name:
- erlang-base
# TLS
- erlang-asn1
- erlang-crypto
- erlang-public-key
- erlang-ssl
# etc (maybe not needed?)
- erlang-mnesia
- erlang-os-mon
- erlang-parsetools
- erlang-runtime-tools
- erlang-snmp
- erlang-syntax-tools
- erlang-tftp
- erlang-tools
- erlang-xmerl
state: latest

- name: Install RabbitMQ TLS dependencies
- name: Install RabbitMQ Server
apt:
name: "{{ item }}"
state: latest
loop:
- erlang-asn1
- erlang-crypto
- erlang-public-key
- erlang-ssl
name: rabbitmq-server
state: fixed

- name: Ensure TLS config
copy:
Expand Down

0 comments on commit 92095ee

Please sign in to comment.