sous-chefs / sous-chefs/postgresql

multiple mapping per map name in pg_ident

Open
#787 0 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
376
Forks
552
Avg merge
5h 43m
Merged PRs (30d)
1

Description

👻 Brief Description

It is perfectly fine have more mappings per mapname, ref.

The current implementation doesn't allow repetitions of mapnames in
pg_ident.conf.

🥞 Cookbook version

Version 12.1.0

👩‍🍳 Chef-Infra Version

Version 18.6.2

🎩 Platform details

Debian 11/12

Steps To Reproduce

Steps to reproduce the behavior:

postgresql_ident 'someuser to postgres mapping' do
  map_name 'someuser_postgres'
  system_username 'someuser'
  database_username 'postgres'
  action :create
   
  notifies :reload, 'postgresql_service[postgresql]', :delayed
end
   
# Make sure that the postgres keeps its own identity
# Without this, the cookbook will fail to run
postgresql_ident 'postgres to postgres mapping' do  
  map_name 'someuser_postgres'
  system_username 'postgres'
  database_username 'postgres'
  action :create
   
  notifies :reload, 'postgresql_service[postgresql]', :delayed
end

🚓 Expected behavior

I would expect a pg_ident.conf to look like:

#
# Generated by Chef for ident-17-debian-12.vagrantup.com
# Do NOT modify this file by hand.
#

# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
someuser_postgres        postgres                postgres
someuser_postgres        someuser              postgres

but because the mapname's are the same, only one line is written. for example:

#
# Generated by Chef for ident-17-debian-12.vagrantup.com
# Do NOT modify this file by hand.
#

# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
someuser_postgres        postgres                postgres

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.