diff --git a/radon.yml b/radon.yml index bab542f..c559993 100644 --- a/radon.yml +++ b/radon.yml @@ -13,6 +13,9 @@ nodered_image: nodered/node-red:3.0.1-1-18 nodered_data: "{{ data_dir }}/nodered" + rabbitmq_image: "bitnami/rabbitmq:3.10.7" + rabbitmq_data: "{{ data_dir }}/rabbitmq" + roles: - role: docker_setup vars: @@ -79,6 +82,33 @@ 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: - name: restart mosquitto docker_container: