Skip to content

Conversation

@sghosh23
Copy link
Contributor

@sghosh23 sghosh23 commented Oct 22, 2025

  • Move repmgr and wire-server passwords from inventory to K8s secrets
  • Create unified postgresql-secrets.yml playbook for all PG credentials
  • Add runtime validation with helpful error messages in dependent playbooks
  • Remove hardcoded passwords from group_vars (security improvement)
  • Update documentation with new tag strategy and password access commands
  • Simplify wire-setup playbook by removing duplicate secret logic

Security improvements:

  • No hardcoded credentials in version control
  • Auto-generate 32-character strong passwords
  • Passwords managed centrally in K8s secrets
  • Add no_log directive to prevent password exposure in logs

Technical details:

  • Use modern Ansible password lookup syntax with named parameters
  • Data-driven design with pg_secrets list for easy extensibility
  • Smart tag grouping (postgresql tag runs secrets + primary + replica)
  • Fail-fast validation prevents cryptic undefined variable errors

Change type

  • Fix
  • Feature
  • Documentation
  • Security / Upgrade

Basic information

  • THIS CHANGE REQUIRES A DEPLOYMENT PACKAGE RELEASE
  • THIS CHANGE REQUIRES A WIRE-DOCS RELEASE

Testing

  • I ran/applied the changes myself, in a test environment.
  • The CI job attached to this repo will test it for me.

Tracking

  • I added a new entry in an appropriate subdirectory of changelog.d
  • I mentioned this PR in Jira, OR I mentioned the Jira ticket in this PR.
  • I mentioned this PR in one of the issues attached to one of our repositories.

Knowledge Transfer

  • An Asciinema session is attached to the Jira ticket.

Motivation

Objective

Reason

Use case

- Remove harcoded repmgr password to k8s secret
- Refact postgresql secret management to the secrets playbook
- Update the dependency playbooks in the deploy playbook
@sghosh23 sghosh23 requested review from a team and julialongtin as code owners October 22, 2025 12:04
- Move repmgr and wire-server passwords from inventory to K8s secrets
- Create unified postgresql-secrets.yml playbook for all PG credentials
- Add runtime validation with helpful error messages in dependent playbooks
- Remove hardcoded passwords from group_vars (security improvement)
- Update documentation with new tag strategy and password access commands
- Simplify wire-setup playbook by removing duplicate secret logic

Security improvements:
- No hardcoded credentials in version control
- Auto-generate 32-character strong passwords
- Passwords managed centrally in K8s secrets
- Add no_log directive to prevent password exposure in logs

Technical details:
- Use modern Ansible password lookup syntax with named parameters
- Data-driven design with pg_secrets list for easy extensibility
- Smart tag grouping (postgresql tag runs secrets + primary + replica)
- Fail-fast validation prevents cryptic undefined variable errors
- Update the document with added scenaiors
- Fix changelog.d file
#
# Usage Examples:
# Full deployment: ansible-playbook postgresql-deploy.yml
# Skip cleanup: ansible-playbook postgresql-deploy.yml --skip-tags cleanup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these examples are to be useful, the term before the colon should be a longer explanation than the skip-tags value.

@sghosh23 sghosh23 changed the title Move scrret creation to a seperate playbook Move secret configuration for postgresql cluster to a seperate playbook Nov 4, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants