Skip to content

Fix redis roles in Geo deployments

Nick Westbury requested to merge fix_redis into master

What does this MR do?

How we work out when to apply redis_master_role isn't working in Geo deployments due to geo_primary_role increasing the matched labels by 1, meaning all secondaries now get marked as a master and the primary gets marked as a replica.

roles ['redis_sentinel_role', '{{ "redis_master_role" if (group_names | select("match", ".*_primary") | list | count == 1) else "redis_replica_role" }}']
ok: [10k-10k-primary-redis-cache-3] => 
  msg:
  - geo_primary_site
ok: [10k-10k-primary-redis-cache-2] => 
  msg:
  - geo_primary_site
ok: [10k-10k-primary-redis-cache-1] => 
  msg:
  - geo_primary_site
  - redis_cache_primary
ok: [10k-10k-primary-redis-persistent-1] => 
  msg:
  - geo_primary_site
  - redis_persistent_primary
ok: [10k-10k-primary-redis-persistent-2] => 
  msg:
  - geo_primary_site
ok: [10k-10k-primary-redis-persistent-3] => 
  msg:
  - geo_primary_site

Merge request reports