2012-04-20 00:37:18 +02:00
|
|
|
# puppet-postgresql
|
|
|
|
# For all details and documentation:
|
|
|
|
# http://github.com/inkling/puppet-postgresql
|
|
|
|
#
|
|
|
|
# Copyright 2012- Inkling Systems, Inc.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2012-06-08 22:37:21 +02:00
|
|
|
class postgresql::initdb(
|
2012-11-03 03:37:20 +01:00
|
|
|
$datadir = $postgresql::params::datadir,
|
|
|
|
$encoding = 'UTF8',
|
|
|
|
$group = 'postgres',
|
2012-06-08 22:37:21 +02:00
|
|
|
$initdb_path = $postgresql::params::initdb_path,
|
2012-11-03 03:37:20 +01:00
|
|
|
$options = '',
|
|
|
|
$user = 'postgres'
|
2012-06-08 22:37:21 +02:00
|
|
|
) inherits postgresql::params {
|
2012-04-20 00:37:18 +02:00
|
|
|
|
2012-11-03 03:37:20 +01:00
|
|
|
exec { "${initdb_path} --encoding '${encoding}' --pgdata '${datadir}'":
|
2012-06-08 22:37:21 +02:00
|
|
|
creates => "${datadir}/PG_VERSION",
|
2012-11-03 03:37:20 +01:00
|
|
|
user => $user,
|
|
|
|
group => $group,
|
2012-11-22 05:18:03 +01:00
|
|
|
require => Package["$postgresql::params::server_package_name"],
|
2012-04-20 00:37:18 +02:00
|
|
|
}
|
|
|
|
}
|