rabbitmq_cluster: expire /bodhi queues that are idle more than 1 week.

Fixes https://pagure.io/fedora-infrastructure/issue/9170

Lets just have rabbitmq cleaup any queues in the /bodhi vhost that are
around for more than a week idle.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2021-02-01 16:19:54 -08:00 committed by kevin
parent 0bf41f71ca
commit a7ddcf5828

View file

@ -169,7 +169,7 @@
- rabbitmq_cluster - rabbitmq_cluster
- config - config
- name: Add a policy to limit queues to 1GB and remove after a month of no use - name: Add a policy to limit queues to 1GB and remove after a month of no use for /pubsub
run_once: true run_once: true
delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org" delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org"
with_items: "{{ datacenter }}" with_items: "{{ datacenter }}"
@ -188,6 +188,23 @@
- rabbitmq_cluster - rabbitmq_cluster
- config - config
- name: Add a policy to remove after a week of no use for /bodhi
run_once: true
delegate_to: "rabbitmq01{{ env_suffix }}.{{ item }}.fedoraproject.org"
with_items: "{{ datacenter }}"
rabbitmq_policy:
apply_to: queues
name: bodhi_sweeper
state: present
pattern: ".*"
tags:
# Unused queues are killed after 1000 * 60 * 60 * 7 milliseconds (~a week)
expires: 25200000
vhost: /bodhi
tags:
- rabbitmq_cluster
- config
- name: Create the admin user for the {{ item }} vhost - name: Create the admin user for the {{ item }} vhost
rabbitmq_user: rabbitmq_user:
user: admin user: admin