Create a command playbook to delete a rabbitmq queue
This commit is contained in:
parent
f14027a1fa
commit
c9a1543185
1 changed files with 26 additions and 0 deletions
26
playbooks/manual/rabbit/delete-queue.yml
Normal file
26
playbooks/manual/rabbit/delete-queue.yml
Normal 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) }}"
|
Loading…
Add table
Add a link
Reference in a new issue