From 8c02e63dd55bce2847a0d23c9975ba392b0238aa Mon Sep 17 00:00:00 2001 From: sghosh23 Date: Thu, 2 Apr 2026 15:42:55 +0200 Subject: [PATCH 1/2] fix: correct inventory syntax errors in 99-static for rabbitmq and repmgr - Fix rabbitmq_cluster_master using YAML colon syntax instead of INI key=value syntax, which caused Ansible parse warnings and the wrong node name being used when joining the RabbitMQ cluster - Move repmgr_node_config from 99-static (INI, unsupported YAML dict) into group_vars/postgresql/postgresql.yml (proper YAML) Co-Authored-By: Claude Sonnet 4.6 --- ansible/inventory/offline/99-static | 16 ++-------------- .../group_vars/postgresql/postgresql.yml | 18 ++++++++++++++++-- .../fix-rabbitmq-repmgr-inventory-syntax | 1 + 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 changelog.d/5-bug-fixes/fix-rabbitmq-repmgr-inventory-syntax diff --git a/ansible/inventory/offline/99-static b/ansible/inventory/offline/99-static index f6e469574..ea0c92d03 100644 --- a/ansible/inventory/offline/99-static +++ b/ansible/inventory/offline/99-static @@ -83,19 +83,7 @@ [postgresql:vars] postgresql_network_interface = enp1s0 -repmgr_node_config: - postgresql1: # Maps to postgresql_rw group - node_id: 1 - priority: 150 - role: primary - postgresql2: # Maps to first postgresql_ro - node_id: 2 - priority: 100 - role: standby - postgresql3: # Maps to second postgresql_ro - node_id: 3 - priority: 50 - role: standby +# repmgr_node_config is defined in group_vars/postgresql/repmgr_node_config.yml [elasticsearch:vars] # elasticsearch_network_interface = enp1s0 @@ -111,7 +99,7 @@ repmgr_node_config: # Rabbitmq specific variables [rmq-cluster:vars] # host name here must match each node's actual hostname -rabbitmq_cluster_master: rabbitmq1 +rabbitmq_cluster_master = rabbitmq1 # rabbitmq_network_interface = enp1s0 # For the following groups, add all nodes defined above to the sections below. diff --git a/ansible/inventory/offline/group_vars/postgresql/postgresql.yml b/ansible/inventory/offline/group_vars/postgresql/postgresql.yml index 351b99539..dd6d6bde4 100644 --- a/ansible/inventory/offline/group_vars/postgresql/postgresql.yml +++ b/ansible/inventory/offline/group_vars/postgresql/postgresql.yml @@ -24,8 +24,22 @@ repmgr_namespace: "{{ wire_namespace | default('default') }}" wire_pg_secret_name: "wire-postgresql-external-secret" # Node configuration for repmgr -# NOTE: repmgr_node_config is defined in the inventory file ansible/inventory/offline/99-static, ansible/inventory/offline/staging.yml and terraform/examples/wire-server-deploy-offline-hetzner/outputs.tf -# to allow environment-specific node mappings. Do not define here. +# NOTE: staging inventory and terraform-generated envs override this in their own vars: +# - ansible/inventory/offline/staging.yml +# - terraform/examples/wire-server-deploy-offline-hetzner/outputs.tf +repmgr_node_config: + postgresql1: # Maps to postgresql_rw group + node_id: 1 + priority: 150 + role: primary + postgresql2: # Maps to first postgresql_ro + node_id: 2 + priority: 100 + role: standby + postgresql3: # Maps to second postgresql_ro + node_id: 3 + priority: 50 + role: standby # repmgr settings # repmgrd monitoring and reconnection configuration diff --git a/changelog.d/5-bug-fixes/fix-rabbitmq-repmgr-inventory-syntax b/changelog.d/5-bug-fixes/fix-rabbitmq-repmgr-inventory-syntax new file mode 100644 index 000000000..ccfe20e55 --- /dev/null +++ b/changelog.d/5-bug-fixes/fix-rabbitmq-repmgr-inventory-syntax @@ -0,0 +1 @@ +Fixed: rabbitmq_cluster_master and repmgr_node_config syntax errors in offline inventory 99-static From e9d92be96817986a8f198ea24c61a0b4d259a859 Mon Sep 17 00:00:00 2001 From: sghosh23 Date: Thu, 2 Apr 2026 16:05:05 +0200 Subject: [PATCH 2/2] add doc why to use short hostname for rabbitmq --- ansible/inventory/offline/99-static | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/inventory/offline/99-static b/ansible/inventory/offline/99-static index ea0c92d03..0c8d3efcc 100644 --- a/ansible/inventory/offline/99-static +++ b/ansible/inventory/offline/99-static @@ -83,7 +83,7 @@ [postgresql:vars] postgresql_network_interface = enp1s0 -# repmgr_node_config is defined in group_vars/postgresql/repmgr_node_config.yml +# repmgr_node_config is defined in group_vars/postgresql/postgresql.yml [elasticsearch:vars] # elasticsearch_network_interface = enp1s0 @@ -98,7 +98,9 @@ postgresql_network_interface = enp1s0 # Rabbitmq specific variables [rmq-cluster:vars] -# host name here must match each node's actual hostname +# host name here must match each node's actual hostname (short hostname, not FQDN) +# e.g. if the node's FQDN is rabbitmq1.example.com, use: rabbitmq_cluster_master = rabbitmq1 +# Using FQDN here will cause rabbitmqctl join_cluster to fail with a :badarg error rabbitmq_cluster_master = rabbitmq1 # rabbitmq_network_interface = enp1s0