|
11 | 11 | default => $path,
|
12 | 12 | }
|
13 | 13 |
|
| 14 | + # Those are the variables that are marked as "(change requires restart)" |
| 15 | + # on postgresql.conf. Items are ordered as on postgresql.conf. |
| 16 | + # |
| 17 | + # XXX: This resource supports setting other variables without knowing |
| 18 | + # their names. Do not add them here. |
| 19 | + $requires_restart_until = { |
| 20 | + 'data_directory' => undef, |
| 21 | + 'hba_file' => undef, |
| 22 | + 'ident_file' => undef, |
| 23 | + 'external_pid_file' => undef, |
| 24 | + 'listen_addresses' => undef, |
| 25 | + 'port' => undef, |
| 26 | + 'max_connections' => undef, |
| 27 | + 'superuser_reserved_connections' => undef, |
| 28 | + 'unix_socket_directory' => '9.3', # Turned into "unix_socket_directories" |
| 29 | + 'unix_socket_directories' => undef, |
| 30 | + 'unix_socket_group' => undef, |
| 31 | + 'unix_socket_permissions' => undef, |
| 32 | + 'bonjour' => undef, |
| 33 | + 'bonjour_name' => undef, |
| 34 | + 'ssl' => '10', |
| 35 | + 'ssl_ciphers' => '10', |
| 36 | + 'ssl_prefer_server_ciphers' => '10', # New on 9.4 |
| 37 | + 'ssl_ecdh_curve' => '10', # New on 9.4 |
| 38 | + 'ssl_cert_file' => '10', # New on 9.2 |
| 39 | + 'ssl_key_file' => '10', # New on 9.2 |
| 40 | + 'ssl_ca_file' => '10', # New on 9.2 |
| 41 | + 'ssl_crl_file' => '10', # New on 9.2 |
| 42 | + 'shared_buffers' => undef, |
| 43 | + 'huge_pages' => undef, # New on 9.4 |
| 44 | + 'max_prepared_transactions' => undef, |
| 45 | + 'max_files_per_process' => undef, |
| 46 | + 'shared_preload_libraries' => undef, |
| 47 | + 'max_worker_processes' => undef, # New on 9.4 |
| 48 | + 'old_snapshot_threshold' => undef, # New on 9.6 |
| 49 | + 'wal_level' => undef, |
| 50 | + 'wal_log_hints' => undef, # New on 9.4 |
| 51 | + 'wal_buffers' => undef, |
| 52 | + 'archive_mode' => undef, |
| 53 | + 'max_wal_senders' => undef, |
| 54 | + 'max_replication_slots' => undef, # New on 9.4 |
| 55 | + 'track_commit_timestamp' => undef, # New on 9.5 |
| 56 | + 'hot_standby' => undef, |
| 57 | + 'logging_collector' => undef, |
| 58 | + 'cluster_name' => undef, # New on 9.5 |
| 59 | + 'silent_mode' => '9.2', # Removed |
| 60 | + 'track_activity_query_size' => undef, |
| 61 | + 'autovacuum_max_workers' => undef, |
| 62 | + 'autovacuum_freeze_max_age' => undef, |
| 63 | + 'autovacuum_multixact_freeze_max_age' => undef, # New on 9.5 |
| 64 | + 'max_locks_per_transaction' => undef, |
| 65 | + 'max_pred_locks_per_transaction' => undef, |
| 66 | + } |
| 67 | + |
14 | 68 | Exec {
|
15 | 69 | logoutput => 'on_failure',
|
16 | 70 | }
|
17 | 71 |
|
18 |
| - case $name { |
19 |
| - /data_directory|timezone|hba_file|ident_file|include|listen_addresses|port|max_connections|superuser_reserved_connections|unix_socket_director(y|ies)|unix_socket_group|unix_socket_permissions|bonjour|bonjour_name|ssl|ssl_ciphers|shared_buffers|max_prepared_transactions|max_files_per_process|shared_preload_libraries|wal_level|wal_buffers|archive_mode|max_wal_senders|hot_standby|logging_collector|silent_mode|track_activity_query_size|autovacuum_max_workers|autovacuum_freeze_max_age|max_locks_per_transaction|max_pred_locks_per_transaction|restart_after_crash|lc_messages|lc_monetary|lc_numeric|lc_time/: { |
20 |
| - if $postgresql::server::service_restart_on_change { |
21 |
| - Postgresql_conf { |
22 |
| - notify => Class['postgresql::server::service'], |
23 |
| - before => Class['postgresql::server::reload'], |
24 |
| - } |
25 |
| - } else { |
26 |
| - Postgresql_conf { |
27 |
| - before => [ |
28 |
| - Class['postgresql::server::service'], |
29 |
| - Class['postgresql::server::reload'], |
30 |
| - ], |
31 |
| - } |
32 |
| - } |
| 72 | + if ! ($name in $requires_restart_until and ( |
| 73 | + ! $requires_restart_until[$name] or |
| 74 | + versioncmp($postgresql::server::_version, $requires_restart_until[$name]) < 0 |
| 75 | + )) { |
| 76 | + Postgresql_conf { |
| 77 | + notify => Class['postgresql::server::reload'], |
33 | 78 | }
|
34 |
| - |
35 |
| - default: { |
36 |
| - Postgresql_conf { |
37 |
| - notify => Class['postgresql::server::reload'], |
38 |
| - } |
| 79 | + } elsif $postgresql::server::service_restart_on_change { |
| 80 | + Postgresql_conf { |
| 81 | + notify => Class['postgresql::server::service'], |
| 82 | + } |
| 83 | + } else { |
| 84 | + Postgresql_conf { |
| 85 | + before => Class['postgresql::server::service'], |
39 | 86 | }
|
40 | 87 | }
|
41 | 88 |
|
|
0 commit comments