974904dff12a5aa818f05e3b136162f1ef2f9853
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / manifests / init.pp
1 # == Class: postgresql
2 #
3 # This is a base class that can be used to modify catalog-wide settings relating
4 # to the various types in class contained in the postgresql module.
5 #
6 # If you don't declare this class in your catalog, sensible defaults will
7 # be used.  However, if you choose to declare it, it needs to appear *before*
8 # any other types or classes from the postgresql module.
9 #
10 # For examples, see the files in the `tests` directory; in particular,
11 # `/server-yum-postgresql-org.pp`.
12 #
13 # === Parameters
14 #
15 # [*version*]
16 #    The postgresql version to install.  If not specified, the
17 #    module will use whatever version is the default for your
18 #    OS distro.
19 # [*manage_package_repo*]
20 #    This determines whether or not the module should
21 #    attempt to manage the postgres package repository for your
22 #    distro.  Defaults to `false`, but if set to `true`, it can
23 #    be used to set up the official postgres yum/apt package
24 #    repositories for you.
25 # [*package_source*]
26 #    This setting is only used if `manage_package_repo` is
27 #    set to `true`.  It determines which package repository should
28 #    be used to install the postgres packages.  Currently supported
29 #    values include `yum.postgresql.org`.
30 # [*locale*]
31 #    This setting defines the default locale for initdb and createdb
32 #    commands. This default to 'undef' which is effectively 'C'.
33 # [*charset*]
34 #    Sets the default charset to be used for initdb and createdb.
35 #    Defaults to 'UTF8'.
36 # [*datadir*]
37 #    This setting can be used to override the default postgresql
38 #    data directory for the target platform. If not specified, the
39 #    module will use whatever directory is the default for your
40 #    OS distro.
41 # [*confdir*]
42 #    This setting can be used to override the default postgresql
43 #    configuration directory for the target platform. If not
44 #    specified, the module will use whatever directory is the
45 #    default for your OS distro.
46 # [*bindir*]
47 #    This setting can be used to override the default postgresql
48 #    binaries directory for the target platform. If not
49 #    specified, the module will use whatever directory is the
50 #    default for your OS distro.
51 # [*client_package_name*]
52 #    This setting can be used to override the default
53 #    postgresql client package name. If not specified, the module
54 #    will use whatever package name is the default for your
55 #    OS distro.
56 # [*server_package_name*]
57 #    This setting can be used to override the default
58 #    postgresql server package name. If not specified, the module
59 #    will use whatever package name is the default for your
60 #    OS distro.
61 # [*contrib_package_name*]
62 #    This setting can be used to override the default
63 #    postgresql contrib package name. If not specified, the module
64 #    will use whatever package name is the default for your
65 #    OS distro.
66 # [*devel_package_name*]
67 #    This setting can be used to override the default
68 #    postgresql devel package name. If not specified, the module
69 #    will use whatever package name is the default for your
70 #    OS distro.
71 # [*java_package_name*]
72 #    This setting can be used to override the default
73 #    postgresql java package name. If not specified, the module
74 #    will use whatever package name is the default for your
75 #    OS distro.
76 # [*service_name*]
77 #    This setting can be used to override the default
78 #    postgresql service name. If not specified, the module
79 #    will use whatever service name is the default for your
80 #    OS distro.
81 # [*user*]
82 #    This setting can be used to override the default
83 #    postgresql super user and owner of postgresql related files
84 #    in the file system. If not specified, the module will use
85 #    the user name 'postgres'.
86 # [*group*]
87 #    This setting can be used to override the default
88 #    postgresql user group to be used for related files
89 #    in the file system. If not specified, the module will use
90 #    the group name 'postgres'.
91 # [*run_initdb*]
92 #    This setting can be used to explicitly call the initdb
93 #    operation after server package is installed and before
94 #    the postgresql service is started. If not specified, the
95 #    module will decide whether to call initdb or not depending
96 #    on your OS distro.
97 #
98 # === Examples
99 #
100 #   class { 'postgresql':
101 #     version               => '9.2',
102 #     manage_package_repo   => true,
103 #   }
104 #
105 #
106 class postgresql (
107   $version              = $::postgres_default_version,
108   $manage_package_repo  = false,
109   $package_source       = undef,
110   $locale               = undef,
111   $charset              = 'UTF8',
112   $datadir              = undef,
113   $confdir              = undef,
114   $bindir               = undef,
115   $client_package_name  = undef,
116   $server_package_name  = undef,
117   $contrib_package_name = undef,
118   $devel_package_name   = undef,
119   $java_package_name    = undef,
120   $service_name         = undef,
121   $user                 = undef,
122   $group                = undef,
123   $run_initdb           = undef
124 ) {
125
126   class { 'postgresql::params':
127     version                     => $version,
128     manage_package_repo         => $manage_package_repo,
129     package_source              => $package_source,
130     locale                      => $locale,
131     charset                     => $charset,
132     custom_datadir              => $datadir,
133     custom_confdir              => $confdir,
134     custom_bindir               => $bindir,
135     custom_client_package_name  => $client_package_name,
136     custom_server_package_name  => $server_package_name,
137     custom_contrib_package_name => $contrib_package_name,
138     custom_devel_package_name   => $devel_package_name,
139     custom_java_package_name    => $java_package_name,
140     custom_service_name         => $service_name,
141     custom_user                 => $user,
142     custom_group                => $group,
143     run_initdb                  => $run_initdb,
144   }
145 }