add initdb
This commit is contained in:
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"initdb",
|
||||||
|
"pgsql"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -37,6 +37,9 @@ class postgresql_cd::params (
|
|||||||
# Service
|
# Service
|
||||||
$pl_service = 'postgresql'
|
$pl_service = 'postgresql'
|
||||||
|
|
||||||
|
# Directories
|
||||||
|
$pl_data_dir = '/var/lib/pgsql/data/'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
include postgresql_cd::main::config
|
include postgresql_cd::main::config
|
||||||
}
|
}
|
||||||
|
|||||||
16
manifests/server/initdb.pp
Normal file
16
manifests/server/initdb.pp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
## postgresql_cd::server::initdb.pp
|
||||||
|
# Module name: postgresql_cd
|
||||||
|
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||||
|
# @summary Class initiates the database
|
||||||
|
###############################################################################
|
||||||
|
class postgresql_cd::server::initdb (
|
||||||
|
|
||||||
|
) inherits postgresql_cd::params {
|
||||||
|
if $fqdn == $pl_server_fqdn {
|
||||||
|
exec { 'init_pgsql_db':
|
||||||
|
command => 'postgresql-setup --initdb',
|
||||||
|
creates => "${pl_data_dir}/PG_VERSION",
|
||||||
|
path => ['/sbin','/usr/bin'],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user