From df2ddc42b9971163fc5995a7cb41459aea557b4e Mon Sep 17 00:00:00 2001 From: Lars Vogdt Date: Dec 16 2019 08:45:49 +0000 Subject: Merge branch 'cboltz-postgresql-merge' into 'production' De-duplicate postgresql config files See merge request infra/salt!303 --- diff --git a/salt/profile/postgresql/files/postgresql/mirrordb1_infra_opensuse_org/pg_ident.conf b/salt/profile/postgresql/files/postgresql/mirrordb1_infra_opensuse_org/pg_ident.conf deleted file mode 100644 index fed4009..0000000 --- a/salt/profile/postgresql/files/postgresql/mirrordb1_infra_opensuse_org/pg_ident.conf +++ /dev/null @@ -1,47 +0,0 @@ -######################################################## -# Do not edit this file manually its managed by Salt ! # -# Any changes needs be approved via MR in Gitlab. # -######################################################## - -# PostgreSQL User Name Maps -# ========================= -# -# Refer to the PostgreSQL documentation, chapter "Client -# Authentication" for a complete description. A short synopsis -# follows. -# -# This file controls PostgreSQL user name mapping. It maps external -# user names to their corresponding PostgreSQL user names. Records -# are of the form: -# -# MAPNAME SYSTEM-USERNAME PG-USERNAME -# -# (The uppercase quantities must be replaced by actual values.) -# -# MAPNAME is the (otherwise freely chosen) map name that was used in -# pg_hba.conf. SYSTEM-USERNAME is the detected user name of the -# client. PG-USERNAME is the requested PostgreSQL user name. The -# existence of a record specifies that SYSTEM-USERNAME may connect as -# PG-USERNAME. -# -# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a -# regular expression. Optionally this can contain a capture (a -# parenthesized subexpression). The substring matching the capture -# will be substituted for \1 (backslash-one) if present in -# PG-USERNAME. -# -# Multiple maps may be specified in this file and used by pg_hba.conf. -# -# No map names are defined in the default configuration. If all -# system user names and PostgreSQL user names are the same, you don't -# need anything in this file. -# -# This file is read on server startup and when the postmaster receives -# a SIGHUP signal. If you edit the file on a running system, you have -# to SIGHUP the postmaster for the changes to take effect. You can -# use "pg_ctl reload" to do that. - -# Put your actual configuration here -# ---------------------------------- - -# MAPNAME SYSTEM-USERNAME PG-USERNAME diff --git a/salt/profile/postgresql/files/postgresql/mirrordb1_infra_opensuse_org/postgresql.auto.conf b/salt/profile/postgresql/files/postgresql/mirrordb1_infra_opensuse_org/postgresql.auto.conf deleted file mode 100644 index af7125e..0000000 --- a/salt/profile/postgresql/files/postgresql/mirrordb1_infra_opensuse_org/postgresql.auto.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Do not edit this file manually! -# It will be overwritten by the ALTER SYSTEM command. diff --git a/salt/profile/postgresql/files/postgresql/mirrordb2_infra_opensuse_org/pg_ident.conf b/salt/profile/postgresql/files/postgresql/mirrordb2_infra_opensuse_org/pg_ident.conf deleted file mode 100644 index a5870e6..0000000 --- a/salt/profile/postgresql/files/postgresql/mirrordb2_infra_opensuse_org/pg_ident.conf +++ /dev/null @@ -1,42 +0,0 @@ -# PostgreSQL User Name Maps -# ========================= -# -# Refer to the PostgreSQL documentation, chapter "Client -# Authentication" for a complete description. A short synopsis -# follows. -# -# This file controls PostgreSQL user name mapping. It maps external -# user names to their corresponding PostgreSQL user names. Records -# are of the form: -# -# MAPNAME SYSTEM-USERNAME PG-USERNAME -# -# (The uppercase quantities must be replaced by actual values.) -# -# MAPNAME is the (otherwise freely chosen) map name that was used in -# pg_hba.conf. SYSTEM-USERNAME is the detected user name of the -# client. PG-USERNAME is the requested PostgreSQL user name. The -# existence of a record specifies that SYSTEM-USERNAME may connect as -# PG-USERNAME. -# -# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a -# regular expression. Optionally this can contain a capture (a -# parenthesized subexpression). The substring matching the capture -# will be substituted for \1 (backslash-one) if present in -# PG-USERNAME. -# -# Multiple maps may be specified in this file and used by pg_hba.conf. -# -# No map names are defined in the default configuration. If all -# system user names and PostgreSQL user names are the same, you don't -# need anything in this file. -# -# This file is read on server startup and when the postmaster receives -# a SIGHUP signal. If you edit the file on a running system, you have -# to SIGHUP the postmaster for the changes to take effect. You can -# use "pg_ctl reload" to do that. - -# Put your actual configuration here -# ---------------------------------- - -# MAPNAME SYSTEM-USERNAME PG-USERNAME diff --git a/salt/profile/postgresql/files/postgresql/mirrordb2_infra_opensuse_org/postgresql.auto.conf b/salt/profile/postgresql/files/postgresql/mirrordb2_infra_opensuse_org/postgresql.auto.conf deleted file mode 100644 index af7125e..0000000 --- a/salt/profile/postgresql/files/postgresql/mirrordb2_infra_opensuse_org/postgresql.auto.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Do not edit this file manually! -# It will be overwritten by the ALTER SYSTEM command. diff --git a/salt/profile/postgresql/files/postgresql/pg_ident.conf b/salt/profile/postgresql/files/postgresql/pg_ident.conf new file mode 100644 index 0000000..fed4009 --- /dev/null +++ b/salt/profile/postgresql/files/postgresql/pg_ident.conf @@ -0,0 +1,47 @@ +######################################################## +# Do not edit this file manually its managed by Salt ! # +# Any changes needs be approved via MR in Gitlab. # +######################################################## + +# PostgreSQL User Name Maps +# ========================= +# +# Refer to the PostgreSQL documentation, chapter "Client +# Authentication" for a complete description. A short synopsis +# follows. +# +# This file controls PostgreSQL user name mapping. It maps external +# user names to their corresponding PostgreSQL user names. Records +# are of the form: +# +# MAPNAME SYSTEM-USERNAME PG-USERNAME +# +# (The uppercase quantities must be replaced by actual values.) +# +# MAPNAME is the (otherwise freely chosen) map name that was used in +# pg_hba.conf. SYSTEM-USERNAME is the detected user name of the +# client. PG-USERNAME is the requested PostgreSQL user name. The +# existence of a record specifies that SYSTEM-USERNAME may connect as +# PG-USERNAME. +# +# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a +# regular expression. Optionally this can contain a capture (a +# parenthesized subexpression). The substring matching the capture +# will be substituted for \1 (backslash-one) if present in +# PG-USERNAME. +# +# Multiple maps may be specified in this file and used by pg_hba.conf. +# +# No map names are defined in the default configuration. If all +# system user names and PostgreSQL user names are the same, you don't +# need anything in this file. +# +# This file is read on server startup and when the postmaster receives +# a SIGHUP signal. If you edit the file on a running system, you have +# to SIGHUP the postmaster for the changes to take effect. You can +# use "pg_ctl reload" to do that. + +# Put your actual configuration here +# ---------------------------------- + +# MAPNAME SYSTEM-USERNAME PG-USERNAME diff --git a/salt/profile/postgresql/files/postgresql/postgresql.auto.conf b/salt/profile/postgresql/files/postgresql/postgresql.auto.conf new file mode 100644 index 0000000..af7125e --- /dev/null +++ b/salt/profile/postgresql/files/postgresql/postgresql.auto.conf @@ -0,0 +1,2 @@ +# Do not edit this file manually! +# It will be overwritten by the ALTER SYSTEM command. diff --git a/salt/profile/postgresql/server.sls b/salt/profile/postgresql/server.sls index d2ff431..8a8a6eb 100644 --- a/salt/profile/postgresql/server.sls +++ b/salt/profile/postgresql/server.sls @@ -12,14 +12,14 @@ /etc/postgresql/pg_ident.conf: file.managed: - - source: salt://profile/postgresql/files/postgresql/{{ id }}/pg_ident.conf + - source: salt://profile/postgresql/files/postgresql/pg_ident.conf - user: root - group: postgres - mode: 640 /etc/postgresql/postgresql.auto.conf: file.managed: - - source: salt://profile/postgresql/files/postgresql/{{ id }}/postgresql.auto.conf + - source: salt://profile/postgresql/files/postgresql/postgresql.auto.conf - user: root - group: postgres - mode: 640