|
15 | 15 | # puppetdb. You can use the `puppetdb::master::config` class to accomplish this. |
16 | 16 | # |
17 | 17 | # Parameters: |
18 | | -# ['database'] - Which database backend to use; legal values are |
19 | | -# `postgres` (default) or `embedded`. (The `embedded` |
20 | | -# db can be used for very small installations or for |
21 | | -# testing, but is not recommended for use in production |
22 | | -# environments. For more info, see the puppetdb docs.) |
| 18 | +# ['listen_address'] - The address that the web server should bind to |
| 19 | +# for HTTP requests. (defaults to `localhost`. |
| 20 | +# '0.0.0.0' = all) |
| 21 | +# ['listen_port'] - The port on which the puppetdb web server should |
| 22 | +# accept HTTP requests (defaults to 8080). |
| 23 | +# ['open_listen_port'] - If true, open the http listen port on the firewall. |
| 24 | +# (defaults to false). |
| 25 | +# ['ssl_listen_address'] - The address that the web server should bind to |
| 26 | +# for HTTPS requests. (defaults to `$::clientcert`.) |
| 27 | +# Set to '0.0.0.0' to listen on all addresses. |
| 28 | +# ['ssl_listen_port'] - The port on which the puppetdb web server should |
| 29 | +# accept HTTPS requests (defaults to 8081). |
| 30 | +# ['open_ssl_listen_port'] - If true, open the ssl listen port on the firewall. |
| 31 | +# (defaults to true). |
| 32 | +# ['database'] - Which database backend to use; legal values are |
| 33 | +# `postgres` (default) or `embedded`. (The `embedded` |
| 34 | +# db can be used for very small installations or for |
| 35 | +# testing, but is not recommended for use in production |
| 36 | +# environments. For more info, see the puppetdb docs.) |
| 37 | +# ['database_port'] - The port that the database server listens on. |
| 38 | +# (defaults to `5432`; ignored for `embedded` db) |
| 39 | +# ['database_username'] - The name of the database user to connect as. |
| 40 | +# (defaults to `puppetdb`; ignored for `embedded` db) |
| 41 | +# ['database_password'] - The password for the database user. |
| 42 | +# (defaults to `puppetdb`; ignored for `embedded` db) |
| 43 | +# ['database_name'] - The name of the database instance to connect to. |
| 44 | +# (defaults to `puppetdb`; ignored for `embedded` db) |
| 45 | +# ['database_package'] - The puppetdb package name in the package manager |
23 | 46 | # ['puppetdb_version'] - The version of the `puppetdb` package that should |
24 | | -# be installed. You may specify an explicit version |
25 | | -# number, 'present', or 'latest'. Defaults to |
26 | | -# 'present'. |
| 47 | +# be installed. You may specify an explicit version |
| 48 | +# number, 'present', or 'latest'. (defaults to |
| 49 | +# 'present') |
| 50 | +# ['puppetdb_service'] - The name of the puppetdb service. |
| 51 | +# ['manage_redhat_firewall'] - DEPRECATED: Use open_ssl_listen_port instead. |
| 52 | +# boolean indicating whether or not the module |
| 53 | +# should open a port in the firewall on redhat-based |
| 54 | +# systems. Defaults to `false`. This parameter is |
| 55 | +# likely to change in future versions. Possible |
| 56 | +# changes include support for non-RedHat systems and |
| 57 | +# finer-grained control over the firewall rule |
| 58 | +# (currently, it simply opens up the postgres port to |
| 59 | +# all TCP connections). |
| 60 | +# ['confdir'] - The puppetdb configuration directory; defaults to |
| 61 | +# `/etc/puppetdb/conf.d`. |
27 | 62 | # |
28 | 63 | # Actions: |
29 | 64 | # - Creates and manages a puppetdb server and its database server/instance. |
|
34 | 69 | # Sample Usage: |
35 | 70 | # include puppetdb |
36 | 71 | # |
37 | | -# |
38 | | -# TODO: expose more parameters |
39 | | -# |
40 | 72 | class puppetdb( |
41 | | - $database = $puppetdb::params::database, |
42 | | - $puppetdb_package = $puppetdb::params::puppetdb_package, |
43 | | - $puppetdb_version = $puppetdb::params::puppetdb_version, |
44 | | - $puppetdb_service = $puppetdb::params::puppetdb_service, |
45 | | - $confdir = $puppetdb::params::confdir, |
46 | | - $manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall, |
| 73 | + $listen_address = $puppetdb::params::listen_address, |
| 74 | + $listen_port = $puppetdb::params::listen_port, |
| 75 | + $open_listen_port = $puppetdb::params::open_listen_port, |
| 76 | + $ssl_listen_address = $puppetdb::params::ssl_listen_address, |
| 77 | + $ssl_listen_port = $puppetdb::params::ssl_listen_port, |
| 78 | + $open_ssl_listen_port = $puppetdb::params::open_ssl_listen_port, |
| 79 | + $database = $puppetdb::params::database, |
| 80 | + $database_port = $puppetdb::params::database_port, |
| 81 | + $database_username = $puppetdb::params::database_username, |
| 82 | + $database_password = $puppetdb::params::database_password, |
| 83 | + $database_name = $puppetdb::params::database_name, |
| 84 | + $puppetdb_package = $puppetdb::params::puppetdb_package, |
| 85 | + $puppetdb_version = $puppetdb::params::puppetdb_version, |
| 86 | + $puppetdb_service = $puppetdb::params::puppetdb_service, |
| 87 | + $open_postgres_port = $puppetdb::params::open_postgres_port, |
| 88 | + $manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall, |
| 89 | + $confdir = $puppetdb::params::confdir |
47 | 90 | ) inherits puppetdb::params { |
48 | 91 |
|
| 92 | + if ($manage_redhat_firewall) { |
| 93 | + notify {'Deprecation notice: `$manage_redhat_firewall` has been deprecated in `puppetdb` class and will be removed in a future versions. Use $open_ssl_listen_port and $open_postgres_port instead.':} |
| 94 | + } |
| 95 | + |
49 | 96 | class { 'puppetdb::server': |
50 | | - database => $database, |
51 | | - puppetdb_package => $puppetdb_package, |
52 | | - puppetdb_version => $puppetdb_version, |
53 | | - puppetdb_service => $puppetdb_service, |
54 | | - confdir => $confdir, |
55 | | - manage_redhat_firewall => $manage_redhat_firewall, |
| 97 | + listen_address => $listen_address, |
| 98 | + listen_port => $listen_port, |
| 99 | + open_listen_port => $open_listen_port, |
| 100 | + ssl_listen_address => $ssl_listen_address, |
| 101 | + ssl_listen_port => $ssl_listen_port, |
| 102 | + open_ssl_listen_port => $open_ssl_listen_port, |
| 103 | + database => $database, |
| 104 | + database_port => $database_port, |
| 105 | + database_username => $database_username, |
| 106 | + database_password => $database_password, |
| 107 | + database_name => $database_name, |
| 108 | + puppetdb_package => $puppetdb_package, |
| 109 | + puppetdb_version => $puppetdb_version, |
| 110 | + puppetdb_service => $puppetdb_service, |
| 111 | + manage_redhat_firewall => $manage_redhat_firewall, |
| 112 | + confdir => $confdir |
56 | 113 | } |
57 | 114 |
|
58 | 115 | if ($database == 'postgres') { |
59 | 116 | class { 'puppetdb::database::postgresql': |
60 | | - manage_redhat_firewall => $manage_redhat_firewall, |
| 117 | + manage_redhat_firewall => $manage_redhat_firewall ? { |
| 118 | + true => $manage_redhat_firewall, |
| 119 | + false => $open_postgres_port, |
| 120 | + }, |
| 121 | + listen_addresses => $postgres_listen_addresses, |
61 | 122 | before => Class['puppetdb::server'] |
62 | 123 | } |
63 | 124 | } |
|
0 commit comments