mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-28 04:22:18 +08:00
Create a command playbook to delete a rabbitmq queue
This commit is contained in:
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) }}"
|
||||
Reference in New Issue
Block a user