aboutsummaryrefslogtreecommitdiff
path: root/ansible/rabbitmq.yml
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2023-05-24 12:21:03 +0100
committerMaksim Malchuk <maksim.malchuk@gmail.com>2023-06-17 21:02:49 +0000
commit6c037790f2802d626902d377486ec2f8ce2c8cda (patch)
tree5d493f7f32f515f36def8729645ca59fc20508aa /ansible/rabbitmq.yml
parenta53052ede30d33bd3c9050f8d1283c10c852c1d2 (diff)
downloadkolla-ansible-6c037790f2802d626902d377486ec2f8ce2c8cda.tar.gz
kolla-ansible-6c037790f2802d626902d377486ec2f8ce2c8cda.zip
Refactor MariaDB and RabbitMQ restart procedure
Ansible 2.14.3 introduced a change that broke the method used for restarting MariaDB and RabbitMQ serially [1][2]. In I57425680a4cdbf0daeb9b2cc35920f1b933aa4a8 we limited to 2.14.2 to work around this. Ansible upstream claim this behaviour was unintentional, and will not fix it. This change moves to a different approach where we use separate plays with a 'serial' keyword to execute the restart. This change also removes the restriction on the maximum supported version of 2.14.2 on ansible-core - any 2.14 release is now supported. [1] https://github.com/ansible/ansible/commit/65366f663de7d044f42ae6dd53368fd4c1f88b35 [2] https://github.com/ansible/ansible/issues/80848 Depends-On: https://review.opendev.org/c/openstack/kolla/+/884208 Change-Id: I5a12670d07077d24047aaff57ce8d33ccf7156ff
Diffstat (limited to 'ansible/rabbitmq.yml')
-rw-r--r--ansible/rabbitmq.yml115
1 files changed, 115 insertions, 0 deletions
diff --git a/ansible/rabbitmq.yml b/ansible/rabbitmq.yml
new file mode 100644
index 000000000..370600c8e
--- /dev/null
+++ b/ansible/rabbitmq.yml
@@ -0,0 +1,115 @@
+---
+# For RabbitMQ we need to be careful about restarting services, to avoid losing quorum.
+- name: Apply role rabbitmq
+ gather_facts: false
+ hosts:
+ - rabbitmq
+ - '&enable_rabbitmq_True'
+ tags:
+ - rabbitmq
+ tasks:
+ - import_role:
+ name: rabbitmq
+ vars:
+ role_rabbitmq_cluster_cookie: '{{ rabbitmq_cluster_cookie }}'
+ role_rabbitmq_cluster_port: '{{ rabbitmq_cluster_port }}'
+ role_rabbitmq_epmd_port: '{{ rabbitmq_epmd_port }}'
+ role_rabbitmq_groups: rabbitmq
+ role_rabbitmq_management_port: '{{ rabbitmq_management_port }}'
+ role_rabbitmq_monitoring_password: '{{ rabbitmq_monitoring_password }}'
+ role_rabbitmq_monitoring_user: '{{ rabbitmq_monitoring_user }}'
+ role_rabbitmq_password: '{{ rabbitmq_password }}'
+ role_rabbitmq_port: '{{ rabbitmq_port }}'
+ role_rabbitmq_prometheus_port: '{{ rabbitmq_prometheus_port }}'
+ role_rabbitmq_user: '{{ rabbitmq_user }}'
+
+- name: Restart rabbitmq services
+ gather_facts: false
+ hosts:
+ - rabbitmq_restart
+ - '&enable_rabbitmq_True'
+ # Restart in batches
+ serial: "33%"
+ tags:
+ - rabbitmq
+ tasks:
+ - import_role:
+ name: rabbitmq
+ tasks_from: restart_services.yml
+ vars:
+ role_rabbitmq_cluster_cookie: '{{ rabbitmq_cluster_cookie }}'
+ role_rabbitmq_groups: rabbitmq
+
+- name: Apply rabbitmq post-configuration
+ gather_facts: false
+ hosts:
+ - rabbitmq
+ - '&enable_rabbitmq_True'
+ tags:
+ - rabbitmq
+ tasks:
+ - name: Include rabbitmq post-deploy.yml
+ include_role:
+ name: rabbitmq
+ tasks_from: post-deploy.yml
+ when: kolla_action in ['deploy', 'reconfigure']
+ vars:
+ role_rabbitmq_cluster_cookie: '{{ rabbitmq_cluster_cookie }}'
+ role_rabbitmq_groups: rabbitmq
+
+- name: Apply role rabbitmq (outward)
+ gather_facts: false
+ hosts:
+ - outward-rabbitmq
+ - '&enable_outward_rabbitmq_True'
+ tags:
+ - rabbitmq
+ tasks:
+ - import_role:
+ name: rabbitmq
+ vars:
+ project_name: outward_rabbitmq
+ role_rabbitmq_cluster_cookie: '{{ outward_rabbitmq_cluster_cookie }}'
+ role_rabbitmq_cluster_port: '{{ outward_rabbitmq_cluster_port }}'
+ role_rabbitmq_epmd_port: '{{ outward_rabbitmq_epmd_port }}'
+ role_rabbitmq_groups: outward-rabbitmq
+ role_rabbitmq_management_port: '{{ outward_rabbitmq_management_port }}'
+ role_rabbitmq_password: '{{ outward_rabbitmq_password }}'
+ role_rabbitmq_port: '{{ outward_rabbitmq_port }}'
+ role_rabbitmq_prometheus_port: '{{ outward_rabbitmq_prometheus_port }}'
+ role_rabbitmq_user: '{{ outward_rabbitmq_user }}'
+
+- name: Restart rabbitmq (outward) services
+ gather_facts: false
+ hosts:
+ - outward_rabbitmq_restart
+ - '&enable_outward_rabbitmq_True'
+ # Restart in batches
+ serial: "33%"
+ tags:
+ - rabbitmq
+ tasks:
+ - import_role:
+ name: rabbitmq
+ tasks_from: restart_services.yml
+ vars:
+ project_name: outward_rabbitmq
+ role_rabbitmq_cluster_cookie: '{{ outward_rabbitmq_cluster_cookie }}'
+ role_rabbitmq_groups: outward-rabbitmq
+
+- name: Apply rabbitmq (outward) post-configuration
+ gather_facts: false
+ hosts:
+ - outward-rabbitmq
+ - '&enable_outward_rabbitmq_True'
+ tags:
+ - rabbitmq
+ tasks:
+ - name: Include rabbitmq (outward) post-deploy.yml
+ include_role:
+ name: rabbitmq
+ when: kolla_action in ['deploy', 'reconfigure']
+ vars:
+ project_name: outward_rabbitmq
+ role_rabbitmq_cluster_cookie: '{{ outward_rabbitmq_cluster_cookie }}'
+ role_rabbitmq_groups: outward-rabbitmq