subspace 0.1.3 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +152 -1
  3. data/TODO +34 -0
  4. data/ansible/roles/apache/tasks/main.yml +5 -2
  5. data/ansible/roles/collectd/defaults/main.yml +3 -0
  6. data/ansible/roles/collectd/handlers/main.yml +3 -0
  7. data/ansible/roles/collectd/tasks/main.yml +43 -0
  8. data/ansible/roles/collectd/templates/delayed_job_postgres.conf +20 -0
  9. data/ansible/roles/collectd/templates/df.conf +16 -0
  10. data/ansible/roles/collectd/templates/graphite.conf +14 -0
  11. data/ansible/roles/collectd/templates/hostname.conf +2 -0
  12. data/ansible/roles/{delayed_job/files/deploy-service → common/files/sudoers-service} +0 -1
  13. data/ansible/roles/common/tasks/main.yml +37 -7
  14. data/ansible/roles/common/tasks/swap.yml +8 -6
  15. data/ansible/roles/common/templates/motd +10 -7
  16. data/ansible/roles/common/templates/motd2 +24 -0
  17. data/ansible/roles/delayed_job/README.md +2 -4
  18. data/ansible/roles/delayed_job/defaults/main.yml +0 -2
  19. data/ansible/roles/delayed_job/meta/main.yml +5 -0
  20. data/ansible/roles/delayed_job/tasks/main.yml +3 -18
  21. data/ansible/roles/delayed_job/templates/delayed-job-monit-rc +1 -1
  22. data/ansible/roles/letsencrypt/defaults/main.yml +1 -1
  23. data/ansible/roles/letsencrypt/tasks/main.yml +27 -23
  24. data/ansible/roles/logrotate/LICENSE +27 -0
  25. data/ansible/roles/logrotate/README.md +70 -0
  26. data/ansible/roles/logrotate/defaults/main.yml +2 -0
  27. data/ansible/roles/logrotate/meta/main.yml +18 -0
  28. data/ansible/roles/logrotate/tasks/main.yml +15 -0
  29. data/ansible/roles/logrotate/templates/logrotate.d.j2 +16 -0
  30. data/ansible/roles/{delayed_job → monit}/files/monit-http.conf +0 -0
  31. data/ansible/roles/monit/files/sudoers-monit +1 -0
  32. data/ansible/roles/monit/handlers/main.yml +3 -0
  33. data/ansible/roles/monit/tasks/main.yml +19 -0
  34. data/ansible/roles/mtpereira.passenger/.bumpversion.cfg +7 -0
  35. data/ansible/roles/mtpereira.passenger/.gitignore +2 -0
  36. data/ansible/roles/mtpereira.passenger/LICENSE +20 -0
  37. data/ansible/roles/mtpereira.passenger/README.md +31 -0
  38. data/ansible/roles/mtpereira.passenger/defaults/main.yml +5 -0
  39. data/ansible/roles/mtpereira.passenger/handlers/main.yml +8 -0
  40. data/ansible/roles/mtpereira.passenger/meta/.galaxy_install_info +1 -0
  41. data/ansible/roles/mtpereira.passenger/meta/main.yml +21 -0
  42. data/ansible/roles/mtpereira.passenger/tasks/apt.yml +13 -0
  43. data/ansible/roles/mtpereira.passenger/tasks/main.yml +8 -0
  44. data/ansible/roles/mtpereira.passenger/tasks/pkg.yml +35 -0
  45. data/ansible/roles/mtpereira.passenger/tasks/service.yml +8 -0
  46. data/ansible/roles/newrelic/tasks/main.yml +4 -1
  47. data/ansible/roles/nginx/tasks/main.yml +8 -1
  48. data/ansible/roles/papertrail/tasks/main.yml +16 -1
  49. data/ansible/roles/passenger/meta/main.yml +6 -0
  50. data/ansible/roles/postgresql/README.md +15 -0
  51. data/ansible/roles/postgresql/defaults/main.yml +3 -0
  52. data/ansible/roles/postgresql/meta/main.yml +1 -1
  53. data/ansible/roles/postgresql/tasks/main.yml +9 -8
  54. data/ansible/roles/postgresql/templates/backup.sh +17 -2
  55. data/ansible/roles/rails/defaults/main.yml +3 -0
  56. data/ansible/roles/rails/tasks/main.yml +7 -7
  57. data/ansible/roles/redis/tasks/main.yml +1 -0
  58. data/ansible/roles/ruby-common/tasks/main.yml +14 -3
  59. data/ansible/roles/sidekiq/README.md +1 -0
  60. data/ansible/roles/sidekiq/meta/main.yml +8 -0
  61. data/ansible/roles/sidekiq/tasks/main.yml +7 -0
  62. data/ansible/roles/sidekiq/templates/sidekiq-monit-rc +6 -0
  63. data/ansible/roles/zenoamaro.postgresql/.gitignore +1 -0
  64. data/ansible/roles/zenoamaro.postgresql/.travis.yml +28 -0
  65. data/ansible/roles/zenoamaro.postgresql/LICENSE.md +21 -0
  66. data/ansible/roles/zenoamaro.postgresql/README.md +117 -0
  67. data/ansible/roles/zenoamaro.postgresql/Vagrantfile +62 -0
  68. data/ansible/roles/zenoamaro.postgresql/boxed.yml +26 -0
  69. data/ansible/roles/zenoamaro.postgresql/defaults/main.yml +606 -0
  70. data/ansible/roles/zenoamaro.postgresql/handlers/main.yml +8 -0
  71. data/ansible/roles/zenoamaro.postgresql/inventory +19 -0
  72. data/ansible/roles/zenoamaro.postgresql/main.yml +19 -0
  73. data/ansible/roles/zenoamaro.postgresql/meta/.galaxy_install_info +1 -0
  74. data/ansible/roles/zenoamaro.postgresql/meta/main.yml +21 -0
  75. data/ansible/roles/zenoamaro.postgresql/tasks/configure.yml +55 -0
  76. data/ansible/roles/zenoamaro.postgresql/tasks/extensions.yml +49 -0
  77. data/ansible/roles/zenoamaro.postgresql/tasks/install.yml +51 -0
  78. data/ansible/roles/zenoamaro.postgresql/tasks/main.yml +5 -0
  79. data/ansible/roles/zenoamaro.postgresql/templates/environment +11 -0
  80. data/ansible/roles/zenoamaro.postgresql/templates/pg_ctl.conf +5 -0
  81. data/ansible/roles/zenoamaro.postgresql/templates/pg_hba.conf +112 -0
  82. data/ansible/roles/zenoamaro.postgresql/templates/pg_ident.conf +46 -0
  83. data/ansible/roles/zenoamaro.postgresql/templates/postgresql.conf +530 -0
  84. data/ansible/roles/zenoamaro.postgresql/test.yml +24 -0
  85. data/exe/subspace +2 -82
  86. data/lib/subspace/cli.rb +85 -0
  87. data/lib/subspace/commands/ansible.rb +20 -0
  88. data/lib/subspace/commands/base.rb +36 -0
  89. data/lib/subspace/commands/bootstrap.rb +47 -0
  90. data/lib/subspace/commands/configure.rb +27 -0
  91. data/lib/subspace/commands/init.rb +79 -0
  92. data/lib/subspace/commands/override.rb +21 -0
  93. data/lib/subspace/commands/provision.rb +10 -0
  94. data/lib/subspace/commands/ssh.rb +14 -0
  95. data/lib/subspace/commands/vars.rb +11 -0
  96. data/lib/subspace/configuration.rb +71 -0
  97. data/lib/subspace/version.rb +1 -1
  98. data/lib/subspace.rb +8 -1
  99. data/subspace.gemspec +2 -0
  100. data/template/provision/ansible.cfg.erb +4 -1
  101. data/template/provision/group_vars/all.erb +2 -0
  102. data/template/provision/group_vars/template.erb +0 -3
  103. data/template/provision/host_vars/template.erb +1 -1
  104. data/template/provision/playbook.yml.erb +0 -10
  105. data/template/provision.rb.erb +94 -0
  106. metadata +90 -8
  107. data/ansible/roles/aws/tasks/main.yml +0 -46
  108. data/lib/subspace/railtie.rb +0 -9
  109. data/lib/tasks/provision.rake +0 -12
@@ -0,0 +1,606 @@
1
+ ---
2
+
3
+ postgresql_version: 9.4
4
+
5
+ # This will be the main admin user, which is only allowed to connect
6
+ # from localhost, mainly for provisioning, maintenance and scripts.
7
+ postgresql_admin_user: postgres
8
+ postgresql_admin_group: "{{postgresql_admin_user}}"
9
+
10
+ # TODO: This has been modeled but there's no real support for clusters yet
11
+ postgresql_cluster: main
12
+
13
+
14
+ # File locations
15
+ # --------------
16
+
17
+
18
+ # Store postgres' configuration files here
19
+ postgresql_conf_directory: "/etc/postgresql/{{postgresql_version}}/{{postgresql_cluster}}"
20
+ # Host-based authentication file
21
+ postgresql_hba_file: "{{postgresql_conf_directory}}/pg_hba.conf"
22
+ # Ident configuration file
23
+ postgresql_ident_file: "{{postgresql_conf_directory}}/pg_ident.conf"
24
+ # Use data in another directory
25
+ postgresql_data_directory: "/var/lib/postgresql/{{postgresql_version}}/{{postgresql_cluster}}"
26
+ # Directory to store runtime data such as PIDs
27
+ postgresql_runtime_directory: "/var/run/postgresql"
28
+ # If external_pid_file is not explicitly set, on extra PID file is written
29
+ postgresql_external_pid_file: "{{postgresql_runtime_directory}}/{{postgresql_version}}-{{postgresql_cluster}}.pid"
30
+ # Store postgresql's logs files here
31
+ postgresql_log_directory: "/var/log/postgresql"
32
+
33
+
34
+ # Connections and authentication
35
+ # ------------------------------
36
+
37
+ # Use 'localhost' for local addresses only. Use '*' alone to
38
+ # listen on every available address.
39
+ postgresql_listen_addresses:
40
+ - localhost
41
+ postgresql_port: 5432
42
+
43
+ # Authenticated connections that will be inserted in `pg_hba.conf`.
44
+ # These won't overwrite the default local idents, which are left
45
+ # untouched as they are useful and safe.
46
+ #
47
+ # Specify connections as a list of hashes having this schema:
48
+ # - type: local
49
+ # user: postgres
50
+ # method: peer
51
+ # database: 'all' # defaults to 'samerole', can also be a list
52
+ # address: '192.168.0.0/24' # optional
53
+ # options: # optional
54
+ # key: value
55
+ #
56
+ # The first field is the connection type: "local" is a Unix-domain
57
+ # socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
58
+ # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
59
+ # plain TCP/IP socket.
60
+ #
61
+ # DATABASE can be "all", "sameuser", "samerole", "replication", a
62
+ # database name, or a comma-separated list thereof. The "all"
63
+ # keyword does not match "replication". Access to replication
64
+ # must be enabled in a separate record (see example below).
65
+ #
66
+ # USER can be "all", a user name, a group name prefixed with "+", or a
67
+ # comma-separated list thereof. In both the DATABASE and USER fields
68
+ # you can also write a file name prefixed with "@" to include names
69
+ # from a separate file.
70
+ #
71
+ # ADDRESS specifies the set of hosts the record matches. It can be a
72
+ # host name, or it is made up of an IP address and a CIDR mask that is
73
+ # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
74
+ # specifies the number of significant bits in the mask. A host name
75
+ # that starts with a dot (.) matches a suffix of the actual host name.
76
+ # Alternatively, you can write an IP address and netmask in separate
77
+ # columns to specify the set of hosts. Instead of a CIDR-address, you
78
+ # can write "samehost" to match any of the server's own IP addresses,
79
+ # or "samenet" to match any address in any subnet that the server is
80
+ # directly connected to.
81
+ #
82
+ # METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
83
+ # "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
84
+ # "password" sends passwords in clear text; "md5" is preferred since
85
+ # it sends encrypted passwords.
86
+ #
87
+ # Database and user names containing spaces, commas, quotes and other
88
+ # special characters must be quoted. Quoting one of the keywords
89
+ # "all", "sameuser", "samerole" or "replication" makes the name lose
90
+ # its special character, and just match a database or username with
91
+ # that name.
92
+ postgresql_authentication: []
93
+
94
+ # Authenticated connections that will be inserted in `pg_hba.conf`.
95
+ # These won't overwrite the default local idents, which are left
96
+ # untouched as they are useful and safe.
97
+ # Specify connections as a list of hashes having this schema:
98
+ # - name: map_a
99
+ # user: system_user
100
+ # pg_user: postgresql_user
101
+ postgresql_user_map: []
102
+
103
+ # A dict whose `key: value`s will be provided as environment
104
+ # variables for the postmaster.
105
+ postgresql_env: {}
106
+
107
+ # Note: Increasing max_connections costs ~400 bytes of shared memory per
108
+ # connection slot, plus lock space (see max_locks_per_transaction).
109
+ postgresql_max_connections: 1024
110
+ postgresql_superuser_reserved_connections: 3
111
+
112
+ postgresql_unix_socket_directories: # comma-separated list of directories
113
+ - /var/run/postgresql
114
+ postgresql_unix_socket_group: ''
115
+ postgresql_unix_socket_permissions: '0777' # begin with 0 to use octal notation
116
+
117
+ # Automatic pg_ctl configuration. Specify a list of options containing
118
+ # cluster specific options to be passed to pg_ctl(1).
119
+ postgresql_pg_ctl_options: []
120
+
121
+ postgresql_bonjour: off # advertise server via Bonjour
122
+ postgresql_bonjour_name: '' # defaults to the computer name
123
+
124
+
125
+ # Security and Authentication
126
+ # ---------------------------
127
+
128
+ postgresql_authentication_timeout: 60s
129
+ postgresql_ssl: off
130
+ postgresql_ssl_ciphers:
131
+ - 'DEFAULT'
132
+ - '!LOW'
133
+ - '!EXP'
134
+ - '!MD5'
135
+ - '@STRENGTH'
136
+ postgresql_ssl_renegotiation_limit: 512MB # amount of data between renegotiations
137
+ postgresql_ssl_cert_file: /etc/ssl/certs/ssl-cert-snakeoil.pem
138
+ postgresql_ssl_key_file: /etc/ssl/private/ssl-cert-snakeoil.key
139
+ postgresql_ssl_ca_file: ''
140
+ postgresql_ssl_crl_file: ''
141
+ postgresql_password_encryption: on
142
+ postgresql_db_user_namespace: off
143
+
144
+ # Kerberos and GSSAPI
145
+ postgresql_krb_server_keyfile: ''
146
+ postgresql_krb_caseins_users: off
147
+
148
+ # TCP Keepalives, 0 selects the system default
149
+ postgresql_tcp_keepalives_idle: 0
150
+ postgresql_tcp_keepalives_interval: 0
151
+ postgresql_tcp_keepalives_count: 0
152
+
153
+
154
+ # Memory
155
+ # ------
156
+
157
+ postgresql_shared_buffers: 128MB # min 128kB
158
+ postgresql_temp_buffers: 8MB # min 800kB
159
+ postgresql_work_mem: 1MB # min 64kB
160
+ postgresql_maintenance_work_mem: 16MB # min 1MB
161
+ postgresql_max_stack_depth: 2MB # min 100kB
162
+
163
+ # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
164
+ # per transaction slot, plus lock space (see max_locks_per_transaction).
165
+ # It is not advisable to set max_prepared_transactions nonzero unless you
166
+ # actively intend to use prepared transactions.
167
+ postgresql_max_prepared_transactions: 0 # zero disables the feature
168
+
169
+ # Disk
170
+ # ----
171
+
172
+ # limits per-session temp file space in kB, or -1 for off limit
173
+ postgresql_temp_file_limit: -1
174
+
175
+ # Kernel Resource Usage
176
+ # ---------------------
177
+
178
+ postgresql_max_files_per_process: 1000 # min 25
179
+ postgresql_shared_preload_libraries: []
180
+
181
+
182
+ # Lock Management
183
+ # ---------------
184
+
185
+ postgresql_deadlock_timeout: 1s
186
+ postgresql_max_locks_per_transaction: 64 # min 10
187
+
188
+ # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
189
+ # max_locks_per_transaction * (max_connections + max_prepared_transactions)
190
+ # lock table slots.
191
+ postgresql_max_pred_locks_per_transaction: 64 # min 10
192
+
193
+
194
+ # Write Ahead Log
195
+ # ---------------
196
+
197
+ postgresql_wal_level: minimal # minimal, archive, or hot_standby
198
+ postgresql_fsync: on # turns forced synchronization on or off
199
+
200
+ # Synchronization level:
201
+ # - off
202
+ # - local
203
+ # - remote_write
204
+ # - on
205
+ postgresql_synchronous_commit: on
206
+
207
+ # The default is the first option supported by the operating system:
208
+ # - open_datasync
209
+ # - fdatasync (default on Linux)
210
+ # - fsync
211
+ # - fsync_writethrough
212
+ # - open_sync
213
+ postgresql_wal_sync_method: fsync
214
+
215
+ # recover from partial page writes
216
+ postgresql_full_page_writes: on
217
+
218
+ postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
219
+ postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
220
+ postgresql_commit_delay: 0 # range 0-100000, in microseconds
221
+ postgresql_commit_siblings: 5 # range 1-1000
222
+
223
+ postgresql_checkpoint_segments: 3 # in logfile segments, min 1, 16MB each
224
+ postgresql_checkpoint_timeout: 5min # range 30s-1h
225
+ postgresql_checkpoint_completion_target: 0.5 # checkpoint target duration, 0.0 - 1.0
226
+ postgresql_checkpoint_warning: 30s # 0 disables
227
+
228
+ # allows archiving to be done
229
+ postgresql_archive_mode: off
230
+
231
+ # Command to use to archive a logfile segment.
232
+ # Placeholders: %p = path of file to archive
233
+ # %f = file name only
234
+ # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
235
+ postgresql_archive_command: ''
236
+
237
+ # force a logfile segment switch after this
238
+ postgresql_archive_timeout: 0
239
+
240
+
241
+ # Replication
242
+ # -----------
243
+
244
+ # Set these on the master and on any standby that will send replication data.
245
+
246
+ # max number of walsender processes
247
+ postgresql_max_wal_senders: 0
248
+
249
+ postgresql_wal_keep_segments: 0 # in logfile segments, 16MB each; 0 disables
250
+ postgresql_wal_sender_timeout: 60s # in milliseconds; 0 disables
251
+
252
+ # Replication (masters)
253
+ # ---------------------
254
+
255
+ # These settings are ignored on a standby server.
256
+
257
+ # Standby servers that provide sync rep.
258
+ # Comma-separated list of application_name from standby(s)
259
+ postgresql_synchronous_standby_names: [] # '*' means 'all'
260
+
261
+ # number of xacts by which cleanup is delayed
262
+ postgresql_vacuum_defer_cleanup_age: 0
263
+
264
+ # "on" allows queries during recovery
265
+ postgresql_hot_standby: off
266
+ # max delay before canceling queries when reading WAL from archive
267
+ postgresql_max_standby_archive_delay: 30s # -1 allows indefinite delay
268
+ # max delay before canceling queries when reading streaming WAL;
269
+ postgresql_max_standby_streaming_delay: 30s # -1 allows indefinite delay
270
+ # send replies at least this often
271
+ postgresql_wal_receiver_status_interval: 10s # 0 disables
272
+ # send info from standby to prevent query conflicts
273
+ postgresql_hot_standby_feedback: off
274
+ #time that receiver waits for communication from master in milliseconds
275
+ postgresql_wal_receiver_timeout: 60s
276
+
277
+
278
+ # Error Reporting And Logging
279
+ # ---------------------------
280
+
281
+ # Valid values are combinations of stderr, csvlog, syslog, and eventlog.
282
+ # depending on platform. Csvlog requires logging_collector to be on.
283
+ postgresql_log_destination: stderr
284
+
285
+ # Enable capturing of stderr and csvlog into log files.
286
+ # Required to be on for csvlogs.
287
+ postgresql_logging_collector: on
288
+
289
+ # These are only used if logging_collector is on:
290
+
291
+ # Log file name pattern, can include strftime() escapes
292
+ postgresql_log_filename: postgresql-%Y-%m-%d_%H%M%S.log
293
+ postgresql_log_file_mode: '0600' # begin with 0 to use octal notation
294
+ # If on, an existing log file with the same name as the new log file will be
295
+ # truncated rather than appended to. But such truncation only occurs on
296
+ # time-driven rotation, not on restarts or size-driven rotation. Default is
297
+ # off, meaning append to existing files in all cases.
298
+ postgresql_log_truncate_on_rotation: off
299
+ # Automatic rotation of logfiles will happen after that time.
300
+ postgresql_log_rotation_age: 1d
301
+ # Automatic rotation of logfiles will happen after that much log output.
302
+ postgresql_log_rotation_size: 10MB
303
+
304
+ # These are relevant when logging to syslog:
305
+ postgresql_syslog_facility: LOCAL0
306
+ postgresql_syslog_ident: postgres
307
+ # This is only relevant when logging to eventlog (win32):
308
+ postgresql_event_source: PostgreSQL
309
+
310
+ # Values in order of decreasing detail:
311
+ # - debug5
312
+ # - debug4
313
+ # - debug3
314
+ # - debug2
315
+ # - debug1
316
+ # - log
317
+ # - notice
318
+ # - warning
319
+ # - error
320
+ postgresql_client_min_messages: notice
321
+
322
+ # Values in order of decreasing detail:
323
+ # - debug5
324
+ # - debug4
325
+ # - debug3
326
+ # - debug2
327
+ # - debug1
328
+ # - info
329
+ # - notice
330
+ # - warning
331
+ # - error
332
+ # - log
333
+ # - fatal
334
+ # - panic
335
+ postgresql_log_min_messages: warning
336
+
337
+ # Values in order of decreasing detail:
338
+ # - debug5
339
+ # - debug4
340
+ # - debug3
341
+ # - debug2
342
+ # - debug1
343
+ # - info
344
+ # - notice
345
+ # - warning
346
+ # - error
347
+ # - log
348
+ # - fatal
349
+ # - panic (effectively off)
350
+ postgresql_log_min_error_statement: error
351
+
352
+ # -1 is disabled, 0 logs all statements and their durations, > 0 logs only
353
+ # statements running at least this number of milliseconds
354
+ postgresql_log_min_duration_statement: -1
355
+
356
+ postgresql_debug_print_parse: off
357
+ postgresql_debug_print_rewritten: off
358
+ postgresql_debug_print_plan: off
359
+ postgresql_debug_pretty_print: on
360
+ postgresql_log_checkpoints: off
361
+ postgresql_log_connections: off
362
+ postgresql_log_disconnections: off
363
+ postgresql_log_duration: off
364
+ postgresql_log_error_verbosity: default # terse, default, or verbose messages
365
+ postgresql_log_hostname: off
366
+
367
+ # Special values:
368
+ # %a = application name
369
+ # %u = user name
370
+ # %d = database name
371
+ # %r = remote host and port
372
+ # %h = remote host
373
+ # %p = process ID
374
+ # %t = timestamp without milliseconds
375
+ # %m = timestamp with milliseconds
376
+ # %i = command tag
377
+ # %e = SQL state
378
+ # %c = session ID
379
+ # %l = session line number
380
+ # %s = sessioan start timestamp
381
+ # %v = virtual transaction ID
382
+ # %x = transaction ID (0 if none)
383
+ # %q = stop here in non-session
384
+ # processes
385
+ # %% = '%'
386
+ postgresql_log_line_prefix: '%t '
387
+
388
+ # log lock waits >= deadlock_timeout
389
+ postgresql_log_lock_waits: off
390
+ postgresql_log_statement: none # none, ddl, mod, all
391
+ # log temporary files equal or larger
392
+ postgresql_log_temp_files: -1
393
+ postgresql_log_timezone: UTC
394
+
395
+
396
+ # Runtime statistics
397
+ # ------------------
398
+
399
+ postgresql_track_activities: on
400
+ postgresql_track_counts: on
401
+ postgresql_track_io_timing: off
402
+ postgresql_track_functions: none # none, pl, all
403
+ postgresql_track_activity_query_size: 1024
404
+ postgresql_update_process_title: on
405
+ postgresql_stats_temp_directory: pg_stat_tmp
406
+
407
+ postgresql_log_parser_stats: off
408
+ postgresql_log_planner_stats: off
409
+ postgresql_log_executor_stats: off
410
+ postgresql_log_statement_stats: off
411
+
412
+
413
+ # Error Handling
414
+ # --------------
415
+
416
+ # Terminate session on any error?
417
+ postgresql_exit_on_error: off
418
+ # Reinitialize after backend crash?
419
+ postgresql_restart_after_crash: on
420
+
421
+
422
+ # Query Tuning (Planner)
423
+ # ----------------------
424
+
425
+ postgresql_enable_bitmapscan: on
426
+ postgresql_enable_hashagg: on
427
+ postgresql_enable_hashjoin: on
428
+ postgresql_enable_indexscan: on
429
+ postgresql_enable_indexonlyscan: on
430
+ postgresql_enable_material: on
431
+ postgresql_enable_mergejoin: on
432
+ postgresql_enable_nestloop: on
433
+ postgresql_enable_seqscan: on
434
+ postgresql_enable_sort: on
435
+ postgresql_enable_tidscan: on
436
+
437
+ postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
438
+ postgresql_random_page_cost: 4.0 # same scale as above
439
+ postgresql_cpu_tuple_cost: 0.01 # same scale as above
440
+ postgresql_cpu_index_tuple_cost: 0.005 # same scale as above
441
+ postgresql_cpu_operator_cost: 0.0025 # same scale as above
442
+ postgresql_effective_cache_size: 128MB
443
+
444
+ # Query Tuning (Genetic Query Optimizer)
445
+ # --------------------------------------
446
+
447
+ postgresql_geqo: on
448
+ postgresql_geqo_threshold: 12
449
+ postgresql_geqo_effort: 5 # range 1-10
450
+ postgresql_geqo_pool_size: 0 # selects default based on effort
451
+ postgresql_geqo_generations: 0 # selects default based on effort
452
+ postgresql_geqo_selection_bias: 2.0 # range 1.5-2.0
453
+ postgresql_geqo_seed: 0.0 # range 0.0-1.0
454
+
455
+ # Query Tuning (Other Planner Options)
456
+ # ------------------------------------
457
+
458
+ postgresql_default_statistics_target: 100 # range 1-10000
459
+ postgresql_constraint_exclusion: partition # on, off, or partition
460
+ postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
461
+ postgresql_from_collapse_limit: 8
462
+ postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
463
+
464
+
465
+ # Cost-Based Vacuum Delay
466
+ # -----------------------
467
+
468
+ postgresql_vacuum_cost_delay: 0 # 0-100 milliseconds
469
+ postgresql_vacuum_cost_page_hit: 1 # 0-10000 credits
470
+ postgresql_vacuum_cost_page_miss: 10 # 0-10000 credits
471
+ postgresql_vacuum_cost_page_dirty: 20 # 0-10000 credits
472
+ postgresql_vacuum_cost_limit: 200 # 1-10000 credits
473
+
474
+
475
+ # Autovacuum Parameters
476
+ # ---------------------
477
+
478
+ # Enable autovacuum subprocess? 'on' requires track_counts to also be on.
479
+ postgresql_autovacuum: on
480
+ # -1 disables, 0 logs all actions and their durations, > 0 logs only
481
+ # actions running at least this number of milliseconds.
482
+ postgresql_log_autovacuum_min_duration: -1
483
+ # max number of autovacuum subprocesses
484
+ postgresql_autovacuum_max_workers: 3
485
+ # time between autovacuum runs
486
+ postgresql_autovacuum_naptime: 1min
487
+ # min number of row updates before vacuum
488
+ postgresql_autovacuum_vacuum_threshold: 50
489
+ # min number of row updates before analyze
490
+ postgresql_autovacuum_analyze_threshold: 50
491
+ # fraction of table size before vacuum
492
+ postgresql_autovacuum_vacuum_scale_factor: 0.2
493
+ # fraction of table size before analyze
494
+ postgresql_autovacuum_analyze_scale_factor: 0.1
495
+ # maximum XID age before forced vacuum
496
+ postgresql_autovacuum_freeze_max_age: 200000000
497
+ # default vacuum cost delay for autovacuum, in milliseconds
498
+ postgresql_autovacuum_vacuum_cost_delay: 20ms
499
+ # default vacuum cost limit for autovacuum,
500
+ postgresql_autovacuum_vacuum_cost_limit: -1
501
+
502
+
503
+ # Background Writer
504
+ # -----------------
505
+
506
+ postgresql_bgwriter_delay: 200ms # 10-10000ms between rounds
507
+ postgresql_bgwriter_lru_maxpages: 100 # 0-1000 max buffers written/round
508
+ postgresql_bgwriter_lru_multiplier: 2.0 # 0-10.0 multipler on buffers scanned/round
509
+
510
+
511
+ # Asynchronous Behavior
512
+ # ---------------------
513
+
514
+ postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
515
+
516
+
517
+ # Client Connection Defaults
518
+ # --------------------------
519
+
520
+ postgresql_search_path: # schema names
521
+ - '"$user"'
522
+ - public
523
+ postgresql_default_tablespace: '' # a tablespace name, '' uses the default
524
+ postgresql_temp_tablespaces: [] # a list of tablespace names
525
+
526
+ postgresql_check_function_bodies: on
527
+ postgresql_default_transaction_isolation: read committed
528
+ postgresql_default_transaction_read_only: off
529
+ postgresql_default_transaction_deferrable: off
530
+ postgresql_session_replication_role: origin
531
+
532
+ postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled
533
+ postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled
534
+ postgresql_vacuum_freeze_min_age: 50000000
535
+ postgresql_vacuum_freeze_table_age: 150000000
536
+
537
+ postgresql_bytea_output: hex # hex, escape
538
+ postgresql_xmlbinary: base64
539
+ postgresql_xmloption: content
540
+
541
+ # Select the set of available time zone abbreviations. Currently, there are:
542
+ # Default
543
+ # Australia
544
+ # India
545
+ # You can create your own file in `share/timezonesets/`.
546
+ postgresql_timezone_abbreviations: Default
547
+
548
+ postgresql_datestyle:
549
+ - iso
550
+ - mdy
551
+ postgresql_intervalstyle: postgres
552
+ postgresql_timezone: UTC
553
+ postgresql_extra_float_digits: 0 # min -15, max 3
554
+ postgresql_client_encoding: sql_ascii # 'sql_ascii' actually defaults to database encoding
555
+
556
+ # These settings are initialized by initdb, but they can be changed.
557
+
558
+ # locale for system error message
559
+ postgresql_lc_messages: en_US.UTF-8
560
+ # locale for monetary formatting
561
+ postgresql_lc_monetary: en_US.UTF-8
562
+ # locale for number formatting
563
+ postgresql_lc_numeric: en_US.UTF-8
564
+ # locale for time formatting
565
+ postgresql_lc_time: en_US.UTF-8
566
+
567
+ postgresql_default_text_search_config: pg_catalog.english
568
+
569
+ postgresql_dynamic_library_path: '$libdir'
570
+ postgresql_local_preload_libraries: []
571
+
572
+
573
+ # Version/platform Compatibility
574
+ # ------------------------------
575
+
576
+ postgresql_array_nulls: on
577
+ postgresql_backslash_quote: safe_encoding # on, off, or safe_encoding
578
+ postgresql_default_with_oids: off
579
+ postgresql_escape_string_warning: on
580
+ postgresql_lo_compat_privileges: off
581
+ postgresql_quote_all_identifiers: off
582
+ postgresql_sql_inheritance: on
583
+ postgresql_standard_conforming_strings: on
584
+ postgresql_synchronize_seqscans: on
585
+ postgresql_transform_null_equals: off
586
+
587
+
588
+ # Extensions
589
+ # ----------
590
+
591
+ # If enabled, this will install the contrib packages.
592
+
593
+ postgresql_contrib: no
594
+
595
+
596
+ # If enabled, will install the [PostGIS] extension
597
+ # from the repositories, at the indicated version.
598
+ # [PostGIS] http://postgis.net/
599
+
600
+ postgresql_postgis: no
601
+ postgresql_postgis_version: '2.1'
602
+
603
+
604
+ # If enabled, this will install the development headers.
605
+
606
+ postgresql_dev_headers: no
@@ -0,0 +1,8 @@
1
+ ---
2
+ - name: restart postgresql
3
+ sudo: yes
4
+ service: name=postgresql state=restarted
5
+
6
+ - name: reload postgresql
7
+ sudo: yes
8
+ service: name=postgresql state=reloaded
@@ -0,0 +1,19 @@
1
+ [boxed]
2
+ 192.168.33.10 ansible_ssh_private_key_file=.vagrant/machines/boxed/virtualbox/private_key
3
+
4
+ [test-ubuntu-precise]
5
+ 192.168.33.20 ansible_ssh_private_key_file=.vagrant/machines/test-ubuntu-precise/virtualbox/private_key
6
+
7
+ [test-ubuntu-trusty]
8
+ 192.168.33.21 ansible_ssh_private_key_file=.vagrant/machines/test-ubuntu-trusty/virtualbox/private_key
9
+
10
+ [test:children]
11
+ test-ubuntu-precise
12
+ test-ubuntu-trusty
13
+
14
+ [vagrant:children]
15
+ test
16
+ boxed
17
+
18
+ [vagrant:vars]
19
+ ansible_ssh_user=vagrant
@@ -0,0 +1,19 @@
1
+ ---
2
+
3
+ # Quick-provisioning playbook
4
+ # ---------------------------
5
+
6
+ # A Simple, straight playbook for quick remote installations.
7
+ # You will be asked which hosts to provision before-hand.
8
+
9
+
10
+ - name: 'PostgreSQL'
11
+
12
+ vars_prompt:
13
+ selected_hosts: Specify the hosts to provision
14
+
15
+ hosts: "{{selected_hosts}}"
16
+
17
+ roles:
18
+ - '.' # The current directory itself is the role
19
+
@@ -0,0 +1 @@
1
+ {install_date: 'Mon Jan 2 18:15:21 2017', version: v0.1.2}
@@ -0,0 +1,21 @@
1
+ ---
2
+
3
+ galaxy_info:
4
+ author: zenoamaro
5
+ description: A role for installing and configuring PostgreSQL
6
+ version: 0.1.2
7
+ license: MIT
8
+ min_ansible_version: 1.4
9
+
10
+ platforms:
11
+ - name: Debian
12
+ - name: Ubuntu
13
+ versions:
14
+ - precise
15
+ - trusty
16
+
17
+ categories:
18
+ - database
19
+ - database:sql
20
+
21
+ dependencies: []