Permalink
Browse files

Remove attributes we are no longer using. (#465)

Make a note we now only support PostgreSQL 9.3+.

Add data_dir helper
  • Loading branch information...
1 parent bb02e76 commit 220a8d599abb299047d3d2e9b1d317fa26f8980e @damacus damacus committed Nov 13, 2017
View
@@ -42,3 +42,4 @@ suites:
- name: pg_gem
run_list:
- recipe[test::pg_gem]
+
View
@@ -14,6 +14,14 @@ Installs and configures PostgreSQL as a client or a server.
- Red Hat/CentOS/Scientific 6+
- Fedora
+## PostgreSQL version
+
+We follow the currently supported versions listed on <https://www.postgresql.org/support/versioning/>
+
+The earliest supported version is currently:
+
+- 9.3 (9.3.19)
+
### Chef
- Chef 12.14+
View
@@ -16,165 +16,13 @@
# limitations under the License.
#
-default['postgresql']['enable_pgdg_apt'] = false
-default['postgresql']['enable_pgdg_yum'] = false
-default['postgresql']['use_pgdg_packages'] = false
-
default['postgresql']['server']['config_change_notify'] = :restart
default['postgresql']['assign_postgres_password'] = true
+default['postgresql']['config']['unix_socket_directories'] = '/var/run/postgresql'
# Establish default database name
default['postgresql']['database_name'] = 'template1'
-# Sets OS init system (upstart, systemd, ...), instead of relying on Ohai
-default['postgresql']['server']['init_package'] =
- case node['platform']
- when 'debian'
- if node['platform_version'].to_i <= 7
- 'sysv'
- else
- 'systemd'
- end
- when 'ubuntu'
- if node['platform_version'].to_f < 15.04
- 'upstart'
- else
- 'systemd'
- end
- when 'amazon'
- 'upstart'
- when 'redhat', 'centos', 'scientific', 'oracle'
- if node['platform_version'].to_i < 7
- 'sysv'
- else
- 'systemd'
- end
- when 'fedora'
- 'systemd'
- when 'opensuseleap', 'suse'
- 'systemd'
- else
- 'upstart'
- end
-
-case node['platform']
-when 'debian'
- if node['platform_version'].to_i == 7
- default['postgresql']['version'] = '9.1'
- default['postgresql']['dir'] = '/etc/postgresql/9.1/main'
- default['postgresql']['client']['packages'] = ['postgresql-client-9.1', 'libpq-dev']
- default['postgresql']['server']['packages'] = ['postgresql-9.1']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib-9.1']
- elsif node['platform_version'].to_i == 8
- default['postgresql']['version'] = '9.4'
- default['postgresql']['dir'] = '/etc/postgresql/9.4/main'
- default['postgresql']['client']['packages'] = ['postgresql-client-9.4', 'libpq-dev']
- default['postgresql']['server']['packages'] = ['postgresql-9.4']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib-9.4']
- else # 9+
- default['postgresql']['version'] = '9.6'
- default['postgresql']['dir'] = '/etc/postgresql/9.6/main'
- default['postgresql']['client']['packages'] = ['postgresql-client-9.6', 'libpq-dev']
- default['postgresql']['server']['packages'] = ['postgresql-9.6']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib-9.6']
- end
-
- default['postgresql']['server']['service_name'] = 'postgresql'
-
-when 'ubuntu'
- if node['platform_version'].to_f == 14.04
- default['postgresql']['version'] = '9.3'
- default['postgresql']['dir'] = '/etc/postgresql/9.3/main'
- default['postgresql']['server']['service_name'] = 'postgresql'
- default['postgresql']['client']['packages'] = ['postgresql-client-9.3', 'libpq-dev']
- default['postgresql']['server']['packages'] = ['postgresql-9.3']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib-9.3']
- elsif node['platform_version'].to_f <= 15.10
- default['postgresql']['version'] = '9.4'
- default['postgresql']['dir'] = '/etc/postgresql/9.4/main'
- default['postgresql']['server']['service_name'] = 'postgresql'
- default['postgresql']['client']['packages'] = ['postgresql-client-9.4', 'libpq-dev']
- default['postgresql']['server']['packages'] = ['postgresql-9.4']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib-9.4']
- else
- default['postgresql']['version'] = '9.5'
- default['postgresql']['dir'] = '/etc/postgresql/9.5/main'
- default['postgresql']['server']['service_name'] = 'postgresql'
- default['postgresql']['client']['packages'] = ['postgresql-client-9.5', 'libpq-dev']
- default['postgresql']['server']['packages'] = ['postgresql-9.5']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib-9.5']
- end
-
-when 'fedora'
- default['postgresql']['version'] = '9.5'
- default['postgresql']['setup_script'] = 'postgresql-setup'
- default['postgresql']['dir'] = '/var/lib/pgsql/data'
- default['postgresql']['client']['packages'] = %w(postgresql-devel postgresql-contrib)
- default['postgresql']['server']['packages'] = %w(postgresql-server)
- default['postgresql']['contrib']['packages'] = %w(postgresql-contrib)
- default['postgresql']['server']['service_name'] = 'postgresql'
- default['postgresql']['uid'] = '26'
- default['postgresql']['gid'] = '26'
-
-when 'amazon'
-
- if node['platform_version'].to_f >= 2015.03
- default['postgresql']['version'] = '9.2'
- default['postgresql']['dir'] = '/var/lib/pgsql9/data'
- end
-
- default['postgresql']['client']['packages'] = %w(postgresql-devel)
- default['postgresql']['server']['packages'] = %w(postgresql-server)
- default['postgresql']['contrib']['packages'] = %w(postgresql-contrib)
- default['postgresql']['server']['service_name'] = 'postgresql'
- default['postgresql']['uid'] = '26'
- default['postgresql']['gid'] = '26'
-
-when 'redhat', 'centos', 'scientific', 'oracle'
-
- default['postgresql']['version'] = '8.4'
-
- default['postgresql']['client']['packages'] = 'postgresql84-devel'
- default['postgresql']['server']['packages'] = ['postgresql84-server']
- default['postgresql']['contrib']['packages'] = ['postgresql84-contrib']
-
- default['postgresql']['setup_script'] = 'postgresql-setup'
- default['postgresql']['server']['service_name'] = 'postgresql'
- default['postgresql']['uid'] = '26'
- default['postgresql']['gid'] = '26'
-
- if node['platform_version'].to_f >= 6.0 && node['postgresql']['version'].to_f == 8.4
- default['postgresql']['client']['packages'] = 'postgresql-devel'
- default['postgresql']['server']['packages'] = ['postgresql-server']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib']
- end
-
- if node['platform_version'].to_f >= 7.0
- default['postgresql']['version'] = '9.2'
- default['postgresql']['client']['packages'] = 'postgresql-devel'
- default['postgresql']['server']['packages'] = ['postgresql-server']
- default['postgresql']['contrib']['packages'] = ['postgresql-contrib']
- end
-
-when 'opensuseleap'
- default['postgresql']['dir'] = '/var/lib/pgsql/data'
- default['postgresql']['uid'] = '26'
- default['postgresql']['gid'] = '26'
- default['postgresql']['version'] = '9.4'
- default['postgresql']['client']['packages'] = ['postgresql94', 'postgresql94-devel']
- default['postgresql']['server']['packages'] = ['postgresql94-server']
- default['postgresql']['contrib']['packages'] = ['postgresql94-contrib']
- default['postgresql']['server']['service_name'] = 'postgresql'
-
-when 'suse' # sles 12+
- default['postgresql']['version'] = '9.1'
- default['postgresql']['client']['packages'] = ['postgresql91', 'rubygem-pg']
- default['postgresql']['server']['packages'] = ['postgresql91-server']
- default['postgresql']['contrib']['packages'] = ['postgresql91-contrib']
- default['postgresql']['dir'] = '/var/lib/pgsql/data'
- default['postgresql']['server']['service_name'] = 'postgresql'
-end
-
case node['platform_family']
when 'debian'
default['postgresql']['config']['listen_addresses'] = 'localhost'
@@ -204,21 +52,4 @@
default['postgresql']['config']['default_text_search_config'] = 'pg_catalog.english'
end
-# Deprecated: Please use the new postgresql_access resource. See README for information.
-default['postgresql']['pg_hba'] = []
-
-default['postgresql']['password'] = {}
-
-# set to install a specific version of the ruby gem pg
-# if attribute is not defined, install will pick the latest available pg gem
-default['postgresql']['pg_gem']['version'] = nil
-
-case node['platform_family']
-when 'debian'
- default['postgresql']['pgdg']['release_apt_codename'] = node['lsb']['codename']
- default['postgresql']['pgdg']['repo_apt_url'] = 'http://apt.postgresql.org/pub/repos/apt'
- default['postgresql']['pgdg']['repo_apt_key'] = 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
-
-end
-
default['postgresql']['initdb_locale'] = 'UTF-8'
Oops, something went wrong.

0 comments on commit 220a8d5

Please sign in to comment.