Skip to content

multiple mapping per map name in pg_identΒ #787

Description

@kristofvandam

πŸ‘» 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions