cookbooks
This commit is contained in:
		| @ -0,0 +1,33 @@ | ||||
| # This file was automatically generated and dropped off by Chef! | ||||
|  | ||||
| # PostgreSQL Client Authentication Configuration File | ||||
| # =================================================== | ||||
| # | ||||
| # Refer to the "Client Authentication" section in the PostgreSQL | ||||
| # documentation for a complete description of this file. | ||||
|  | ||||
| local   all             postgres                                peer | ||||
|  | ||||
| # TYPE  DATABASE        USER            ADDRESS                 METHOD | ||||
|  | ||||
| # "local" is for Unix domain socket connections only | ||||
| local   all             all                                     peer | ||||
| # IPv4 local connections: | ||||
| host    all             all             127.0.0.1/32            md5 | ||||
| # IPv6 local connections: | ||||
| host    all             all             ::1/128                 md5 | ||||
|  | ||||
| ########### | ||||
| # From the postgresql_access resources | ||||
| ########### | ||||
| <% @pg_hba.each do |k,v| -%> | ||||
| # <%= k %> | ||||
| <% if v[:comment] -%> | ||||
| # <%= v[:comment] %> | ||||
| <% end -%> | ||||
| <% if v[:addr] %> | ||||
| <%= v[:type].ljust(7) %> <%= v[:db].ljust(15) %> <%= v[:user].ljust(15) %> <%= v[:addr].ljust(23) %> <%= v[:method] %> | ||||
| <% else %> | ||||
| <%= v[:type].ljust(7) %> <%= v[:db].ljust(15) %> <%= v[:user].ljust(15) %>                         <%= v[:method] %> | ||||
| <% end %> | ||||
| <% end %> | ||||
| @ -0,0 +1,49 @@ | ||||
| # 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 | ||||
| <% @pg_ident.each do |k,v| -%> | ||||
|   <% if v[:comment] -%> | ||||
|  | ||||
| # <%= v[:comment] %> | ||||
|   <% end -%> | ||||
| <%= v[:mapname].ljust(15) %> <%= v[:system_user].ljust(23) %> <%= v[:pg_user].ljust(15) %> | ||||
| <% end %> | ||||
| @ -0,0 +1,2 @@ | ||||
| PGDATA=<%= @postgresql_dir %> | ||||
| PGPORT=<%= @port %> | ||||
| @ -0,0 +1,26 @@ | ||||
| # PostgreSQL configuration file | ||||
| # This file was automatically generated and dropped off by chef! | ||||
| # Please refer to the PostgreSQL documentation for details on | ||||
| # configuration settings. | ||||
|  | ||||
| data_directory = '<%= @data_dir %>' | ||||
| hba_file = '<%= @hba_file %>' | ||||
| ident_file = '<%= @ident_file %>' | ||||
| external_pid_file = '<%= @external_pid_file %>' | ||||
| stats_temp_directory = '<%= @stats_temp_directory %>' | ||||
| port = <%= @port %> | ||||
| <% @additional_config.sort.each do |key, value| %> | ||||
| <% next if value.nil? -%> | ||||
| <%= key %> = <%= | ||||
|   case value | ||||
|   when String | ||||
|     "'#{value}'" | ||||
|   when TrueClass | ||||
|     'on' | ||||
|   when FalseClass | ||||
|     'off' | ||||
|   else | ||||
|     value | ||||
|   end | ||||
| %> | ||||
| <% end %> | ||||
| @ -0,0 +1,6 @@ | ||||
| [Service] | ||||
| .include /usr/lib/systemd/system/<%= @svc_name %>.service | ||||
|  | ||||
| Environment= | ||||
| Environment=PGPORT=<%= @port %> | ||||
| Environment=PGDATA=<%= @data_dir %> | ||||
		Reference in New Issue
	
	Block a user