Add RabbitMQ container on Radon

This commit is contained in:
Stefan Haun 2022-08-24 20:48:46 +02:00
parent 61a0a25183
commit c94a83698a

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: