pgsty / pgsty/pigsty

DBSU SSH key exchange assumes pg_cluster is an inventory group

Open
#770 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
5.7k
Forks
384
Avg merge
2h 36m
Merged PRs (30d)
2

Description

Problem

The DBSU SSH key exchange task currently derives its delegation targets from the Ansible inventory group named by pg_cluster:

with_nested:
  - "{{ [dbsu_ssh_keys.stdout] }}"
  - "{{ groups[pg_cluster] }}"

However, pg_cluster is the logical PostgreSQL cluster identity calculated from instance metadata. It is not guaranteed to be an Ansible group name.

This is visible in Citus inventories: logical clusters such as pg-citus1 and pg-citus2 are members of a broader inventory group, so groups[pg_cluster] may be undefined. As a result, the DBSU SSH key exchange cannot reliably enumerate or delegate to all members of the same logical PostgreSQL cluster.

Expected behavior

The task should exchange each DBSU public key among the members of the same logical PostgreSQL cluster, independently of how hosts are arranged into Ansible inventory groups.

Scope

The issue is limited to DBSU SSH key exchange. Ordinary inventories often hide the problem because their logical cluster name happens to match an inventory group name.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the DBSU SSH key exchange task, especially the with_nested block that uses pg_cluster and groups[pg_cluster]. Trace how pg_cluster is calculated from instance metadata and how Citus inventory members are represented. Done means DBSU public keys are exchanged among all members of the same logical PostgreSQL cluster without depending on an inventory group with that name.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, postgresql
Domain
databases, infrastructure, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.