From dbd763816b5f3c22a7034400005053478130df5c Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 28 Jan 2021 13:48:17 -0800 Subject: [PATCH] rabbitmq cluster / osci queues: adjust so playbook doesn't fail on trying to change queues The osci queue's have changed since this playbook last completed. The ttl changed and the routing keys have changed. The ansible rabbitmq module can't change these things on already created queues because the api doesn't allow it. This makes this playbook fail with: "RabbitMQ RESTAPI doesn't support attribute changes for existing queues" So, for now, set the ttl to what it already is, and don't change the routing keys at all. Hopefully this will get it to complete and osci can manage at least routing keys themseleves wherever they do that. Signed-off-by: Kevin Fenzi --- roles/rabbit/queue/tasks/main.yml | 2 ++ roles/rabbitmq_cluster/tasks/apps.yml | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/roles/rabbit/queue/tasks/main.yml b/roles/rabbit/queue/tasks/main.yml index 00a6a2612a..9e1e039d42 100644 --- a/roles/rabbit/queue/tasks/main.yml +++ b/roles/rabbit/queue/tasks/main.yml @@ -86,6 +86,7 @@ login_user: admin login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" loop: "{{ routing_keys }}" + when: routing_keys is defined tags: - fedora-messaging - rabbitmq_cluster @@ -103,6 +104,7 @@ login_user: admin login_password: "{{ (env == 'production')|ternary(rabbitmq_admin_password_production, rabbitmq_admin_password_staging) }}" loop: "{{ routing_keys }}" + when: routing_keys is defined tags: - fedora-messaging - rabbitmq_cluster diff --git a/roles/rabbitmq_cluster/tasks/apps.yml b/roles/rabbitmq_cluster/tasks/apps.yml index 623fa9936a..d5bead4d53 100644 --- a/roles/rabbitmq_cluster/tasks/apps.yml +++ b/roles/rabbitmq_cluster/tasks/apps.yml @@ -31,11 +31,7 @@ vars: username: osci-pipelines{{ env_suffix }} queue_name: "{{ osci_pipeline_queue }}{{ env_suffix }}" - # TTL: 5 days (in miliseconds) - message_ttl: 432000000 - routing_keys: - # This routing key is for testing purposes only - - "org.centos.ci.#" + message_ttl: 864000000 loop: - osci-pipelines-queue-0 - osci-pipelines-queue-1