Create a command playbook to delete a rabbitmq queue

This commit is contained in:
Aurélien Bompard 2019-02-28 12:15:41 +00:00
parent f14027a1fa
commit c9a1543185

View file

@ -0,0 +1,26 @@
# Remove a RabbitMQ queue
#
# Required parameter:
# - queue_name (str): the name of the queue to delete.
# - vhost (str): the name of the RabbitMQ virtual host
#
# Use --extra-vars to define them.
- assert:
that:
- "queue_name is defined"
fail_msg: "You must define queue_name"
- assert:
that:
- "vhost is defined"
fail_msg: "You must define vhost"
- name: Create the queue in RabbitMQ
hosts: rabbitmq-stg[0]:rabbitmq[0]
rabbitmq_queue:
name: "{{ queue_name }}"
vhost: "{{ vhost }}"
state: absent
login_user: admin
login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}"