diff --git a/roles/rabbitmq_server/templates/post-backup.j2 b/roles/rabbitmq_server/templates/post-backup.j2 index 898c2cb..17d307c 100644 --- a/roles/rabbitmq_server/templates/post-backup.j2 +++ b/roles/rabbitmq_server/templates/post-backup.j2 @@ -1,3 +1,8 @@ #!/bin/bash -e +{% if rabbitmq_conf == 'rabbitmq.conf' %} rm -f /home/lbkp/rabbitmq/definitions.json +{% else %} +# RabbitMQ version too old to support export_definitions +{% endif %} + diff --git a/roles/rabbitmq_server/templates/pre-backup.j2 b/roles/rabbitmq_server/templates/pre-backup.j2 index 1f800c0..b1d722f 100644 --- a/roles/rabbitmq_server/templates/pre-backup.j2 +++ b/roles/rabbitmq_server/templates/pre-backup.j2 @@ -1,5 +1,9 @@ #!/bin/bash -e +{% if rabbitmq_conf == 'rabbitmq.conf' %} mkdir -p /home/lbkp/rabbitmq/ /usr/sbin/rabbitmqctl export_definitions --format json definitions.json mv /var/lib/rabbitmq/definitions.json /home/lbkp/rabbitmq/ +{% else %} +# RabbitMQ version too old to support export_definitions +{% endif %}