Merge pull request ' Add RabbitMQ container on Radon' (!64) from rabbitmq into master

Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/64
Reviewed-by: dkdent <dkdent@netz39.de>
This commit is contained in:
Stefan Haun 2022-08-26 10:24:35 +00:00
commit dd55181917

View file

@ -13,6 +13,9 @@
nodered_image: nodered/node-red:3.0.1-1-18 nodered_image: nodered/node-red:3.0.1-1-18
nodered_data: "{{ data_dir }}/nodered" nodered_data: "{{ data_dir }}/nodered"
rabbitmq_image: "bitnami/rabbitmq:3.10.7"
rabbitmq_data: "{{ data_dir }}/rabbitmq"
roles: roles:
- role: docker_setup - role: docker_setup
vars: vars:
@ -79,6 +82,33 @@
restart_policy: unless-stopped restart_policy: unless-stopped
- name: Check if rabbitmq data dir exists
ansible.builtin.stat:
path: "{{ rabbitmq_data }}"
register: rabbitmq_dir
- name: Fail if rabbitmq data dir does not exist
ansible.builtin.fail:
msg: "RabbitMQ data dir is missing, please restore from the backup!"
when: not rabbitmq_dir.stat.exists
- name: Ensure rabbitmq docker container is running
docker_container:
name: rabbitmq
image: "{{ rabbitmq_image }}"
ports:
- 4369:4369
- 5551:5551
- 5552:5552
- 5672:5672
- 25672:25672
- 15672:15672
env:
RABBITMQ_SECURE_PASSWORD: "yes"
volumes:
- "{{ rabbitmq_data }}/bitnami:/bitnami:rw"
- "{{ rabbitmq_data }}/etc_rabbitmq:/etc/rabbitmq:rw"
handlers: handlers:
- name: restart mosquitto - name: restart mosquitto
docker_container: docker_container: