taperole 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +1 -2
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +39 -0
  6. data/lib/taperole/version.rb +1 -1
  7. data/requirements.yml +6 -2
  8. data/roles/redis/meta/main.yml +3 -0
  9. data/roles/redis/tasks/main.yml +14 -2
  10. data/roles/redis/templates/rc.local.j2 +16 -0
  11. data/roles/redis/templates/thp_enabled.j2 +1 -0
  12. data/taperole.gemspec +1 -0
  13. data/vars/defaults.yml +9 -0
  14. data/vendor/ANXS.postgresql/.travis.yml +8 -6
  15. data/vendor/ANXS.postgresql/README.md +6 -0
  16. data/vendor/ANXS.postgresql/defaults/main.yml +133 -69
  17. data/vendor/ANXS.postgresql/meta/.galaxy_install_info +1 -1
  18. data/vendor/ANXS.postgresql/tasks/configure.yml +15 -5
  19. data/vendor/ANXS.postgresql/tasks/databases.yml +3 -3
  20. data/vendor/ANXS.postgresql/tasks/extensions/dev_headers.yml +11 -1
  21. data/vendor/ANXS.postgresql/tasks/install.yml +1 -1
  22. data/vendor/ANXS.postgresql/templates/postgresql.conf-9.6.j2 +635 -0
  23. data/vendor/ANXS.postgresql/tests/vars.yml +1 -1
  24. data/vendor/ansible-sysfs/.gitignore +30 -0
  25. data/vendor/ansible-sysfs/.travis.yml +60 -0
  26. data/vendor/ansible-sysfs/README.md +68 -0
  27. data/vendor/ansible-sysfs/Vagrantfile +63 -0
  28. data/vendor/ansible-sysfs/defaults/main.yml +3 -0
  29. data/vendor/ansible-sysfs/files/etc/init.d/sysfsutils +82 -0
  30. data/vendor/ansible-sysfs/handlers/main.yml +6 -0
  31. data/vendor/ansible-sysfs/meta/.galaxy_install_info +1 -0
  32. data/vendor/ansible-sysfs/meta/main.yml +21 -0
  33. data/vendor/ansible-sysfs/tasks/main.yml +68 -0
  34. data/vendor/ansible-sysfs/templates/etc/sysfs.d/sysfs.conf.j2 +6 -0
  35. data/vendor/ansible-sysfs/tests/inventory +1 -0
  36. data/vendor/ansible-sysfs/tests/test.yml +43 -0
  37. data/vendor/ansible-sysfs/tests/vagrant.yml +43 -0
  38. data/vendor/ansible-sysfs/vars/main.yml +10 -0
  39. metadata +37 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04c8ed5420729d25e87791048c01bb0f682c444f
4
- data.tar.gz: a0432626ee02d79e36669df0374905710b56c4af
3
+ metadata.gz: bc9a6b83f7d7bcaecf5ee456c4630b8d852aad9a
4
+ data.tar.gz: 1c92589beb65c71024b40700e7e82774e983fc5a
5
5
  SHA512:
6
- metadata.gz: c74dee23fdb912f399a26fd1ad5002aaef27b9bb1c66cf9305c99514d9bc921c7d4589a2e88c0ab1e83a00e179802562d754c3d1857239ebdfb6b5b16d9e72e7
7
- data.tar.gz: 7fb79c490b14c6c68f5b3a5f47866a1f3f23f45524bdc0007c36effc6ed530bf5a0bdd3ccd3edc2fe7e63ef9422e37455ef6d054b9a049cfaf4075da70d924fc
6
+ metadata.gz: f6d3f268a98fac4931a373e621dc50a24a861c1ee7f0c57924cd35dc5d7c55120e8f9e09394676ba579638f39e443bcc444822d97a0e533eaaf4b8de3428b643
7
+ data.tar.gz: 15d34ba9283228dd4925d0f2d039cfbd0e150be47180792b501e4616bec200910eb2f38751d69df1b1343924c9d8586da272eebb298a94c8e219e14df08ab502
data/.gitignore CHANGED
@@ -4,3 +4,5 @@ site_vars.yml
4
4
  hosts
5
5
  *.gem
6
6
  .tape
7
+ vendor/ruby
8
+ .bundle
data/.travis.yml CHANGED
@@ -6,8 +6,7 @@ services:
6
6
  - docker
7
7
 
8
8
  script:
9
- - gem build taperole.gemspec
10
- - gem install --dev taperole
9
+ - bundle install
11
10
  - rake spec
12
11
  - docker build -f test/rails/Dockerfile -t imagetest .
13
12
  - docker run -i -t $(docker images -q imagetest) /start_rails.sh | grep "Hello"
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,39 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ taperole (1.8.0)
5
+ colorize (~> 0.8.1)
6
+ slack-notifier (~> 1.5)
7
+ thor (~> 0.19.1)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ colorize (0.8.1)
13
+ diff-lcs (1.3)
14
+ rspec (3.5.0)
15
+ rspec-core (~> 3.5.0)
16
+ rspec-expectations (~> 3.5.0)
17
+ rspec-mocks (~> 3.5.0)
18
+ rspec-core (3.5.4)
19
+ rspec-support (~> 3.5.0)
20
+ rspec-expectations (3.5.0)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.5.0)
23
+ rspec-mocks (3.5.0)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.5.0)
26
+ rspec-support (3.5.0)
27
+ slack-notifier (1.5.1)
28
+ thor (0.19.4)
29
+
30
+ PLATFORMS
31
+ ruby
32
+
33
+ DEPENDENCIES
34
+ rspec (~> 3.5)
35
+ rspec-expectations (~> 3.5)
36
+ taperole!
37
+
38
+ BUNDLED WITH
39
+ 1.11.2
@@ -1,3 +1,3 @@
1
1
  module Taperole
2
- VERSION = '1.8.0'.freeze
2
+ VERSION = '1.8.1'.freeze
3
3
  end
data/requirements.yml CHANGED
@@ -6,11 +6,15 @@
6
6
 
7
7
  - src: lxhunter.apt
8
8
 
9
- - src: https://github.com/ANXS/postgresql
9
+ - src: ANXS.postgresql
10
10
  name: ANXS.postgresql
11
- version: v1.6.2
11
+ version: v1.7.1
12
12
 
13
13
  - src: geerlingguy.memcached
14
14
  version: 1.0.4
15
15
 
16
16
  - src: tersmitten.htop
17
+
18
+ - src: https://github.com/Oefenweb/ansible-sysfs
19
+ name: ansible-sysfs
20
+ version: v1.0.2
@@ -0,0 +1,3 @@
1
+ ---
2
+ dependencies:
3
+ - role: ansible-sysfs
@@ -1,8 +1,20 @@
1
1
  - name: Get PPA for latest Redis
2
- apt_repository: repo='ppa:rwky/redis' state=present
2
+ apt_repository:
3
+ repo: ppa:chris-lea/redis-server
4
+ update_cache: true
5
+
3
6
 
4
7
  - name: Install Redis
5
- apt: name=redis-server state=latest
8
+ apt:
9
+ name: redis-server
10
+ state: latest
11
+
12
+ - name: kernel | set system overcommit policy
13
+ sysctl:
14
+ name: vm.overcommit_memory
15
+ value: 1
16
+ reload: true
17
+ state: present
6
18
 
7
19
  - name: Register with monit
8
20
  template: src=redis.j2
@@ -0,0 +1,16 @@
1
+ #!/bin/sh -e
2
+ #
3
+ # rc.local
4
+ #
5
+ # This script is executed at the end of each multiuser runlevel.
6
+ # Make sure that the script will "exit 0" on success or any other
7
+ # value on error.
8
+ #
9
+ # In order to enable or disable this script just change the execution
10
+ # bits.
11
+ #
12
+ # By default this script does nothing.
13
+
14
+ /bin/echo never > /sys/kernel/mm/transparent_hugepage/enabled
15
+
16
+ exit 0
@@ -0,0 +1 @@
1
+ never
data/taperole.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.add_runtime_dependency 'slack-notifier', '~> 1.5'
17
17
  spec.add_runtime_dependency 'thor', '~> 0.19.1'
18
18
  spec.add_runtime_dependency 'colorize', '~> 0.8.1'
19
+ spec.add_development_dependency 'rspec-expectations', '~> 3.5'
19
20
  spec.add_development_dependency 'rspec', '~> 3.5'
20
21
  spec.require_paths = ['lib']
21
22
  end
data/vars/defaults.yml CHANGED
@@ -56,6 +56,9 @@ backup_user: root
56
56
  backup_postgres_user: postgres
57
57
  backup_postgres_host: localhost
58
58
 
59
+ # PG Settings
60
+ postgresql_version: 9.4
61
+
59
62
  backup_profiles:
60
63
  - name: postgresql
61
64
  schedule: "{{ backup_schedule }}"
@@ -69,3 +72,9 @@ rbenv:
69
72
  ruby_version: 2.3.1
70
73
 
71
74
  rbenv_group: root
75
+
76
+ # Redis
77
+ sysfs_sysfs_d_files:
78
+ 001-transparent-hugepage.conf:
79
+ - attribute: kernel/mm/transparent_hugepage/enabled
80
+ value: never
@@ -14,11 +14,13 @@ env:
14
14
  - ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="1.9.4"
15
15
  - ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="1.9.4"
16
16
  - ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="1.9.4"
17
- - ROLE_OPTIONS="postgresql_version=9.1" ANSIBLE_VERSION="2.0.0.2"
18
- - ROLE_OPTIONS="postgresql_version=9.2" ANSIBLE_VERSION="2.0.0.2"
19
- - ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="2.0.0.2"
20
- - ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="2.0.0.2"
21
- - ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="2.0.0.2"
17
+ - ROLE_OPTIONS="postgresql_version=9.6" ANSIBLE_VERSION="1.9.4"
18
+ - ROLE_OPTIONS="postgresql_version=9.1" ANSIBLE_VERSION="2.1.2.0"
19
+ - ROLE_OPTIONS="postgresql_version=9.2" ANSIBLE_VERSION="2.1.2.0"
20
+ - ROLE_OPTIONS="postgresql_version=9.3" ANSIBLE_VERSION="2.1.2.0"
21
+ - ROLE_OPTIONS="postgresql_version=9.4" ANSIBLE_VERSION="2.1.2.0"
22
+ - ROLE_OPTIONS="postgresql_version=9.5" ANSIBLE_VERSION="2.1.2.0"
23
+ - ROLE_OPTIONS="postgresql_version=9.6" ANSIBLE_VERSION="2.1.2.0"
22
24
 
23
25
  before_install:
24
26
  # Remove the PostgreSQL installed by Travis
@@ -50,4 +52,4 @@ script:
50
52
 
51
53
  # Testing with docker (experimental)
52
54
  - docker build -f tests/Dockerfile-ubuntu14.04 -t postgres_ubuntu14.04 .
53
- - docker build -f tests/Dockerfile-centos6 -t postgres_centos6 .
55
+ - docker build -f tests/Dockerfile-centos6 -t postgres_centos6 .
@@ -25,10 +25,13 @@ ansible-galaxy install ANXS.postgresql
25
25
  postgresql_version: 9.3
26
26
  postgresql_encoding: 'UTF-8'
27
27
  postgresql_locale: 'en_US.UTF-8'
28
+ postgresql_ctype: 'en_US.UTF-8'
28
29
 
29
30
  postgresql_admin_user: "postgres"
30
31
  postgresql_default_auth_method: "trust"
31
32
 
33
+ postgresql_service_enabled: false # should the service be enabled, default is true
34
+
32
35
  postgresql_cluster_name: "main"
33
36
  postgresql_cluster_reset: false
34
37
 
@@ -40,6 +43,9 @@ postgresql_databases:
40
43
  hstore: yes # flag to install the hstore extension on this database (yes/no)
41
44
  uuid_ossp: yes # flag to install the uuid-ossp extension on this database (yes/no)
42
45
  citext: yes # flag to install the citext extension on this database (yes/no)
46
+ encoding: 'UTF-8' # override global {{ postgresql_encoding }} variable per database
47
+ lc_collate: 'en_GB.UTF-8' # override global {{ postgresql_locale }} variable per database
48
+ lc_ctype: 'en_GB.UTF-8' # override global {{ postgresql_ctype }} variable per database
43
49
 
44
50
  # List of database extensions to be created (optional)
45
51
  postgresql_database_extensions:
@@ -7,6 +7,10 @@ postgresql_locale_parts:
7
7
  - 'en_US' # Locale
8
8
  - 'UTF-8' # Encoding
9
9
  postgresql_locale: "{{ postgresql_locale_parts | join('.') }}"
10
+ postgresql_ctype_parts:
11
+ - 'en_US' # Locale
12
+ - 'UTF-8' # Encoding
13
+ postgresql_ctype: "{{ postgresql_ctype_parts | join('.') }}"
10
14
 
11
15
  postgresql_admin_user: "postgres"
12
16
  postgresql_default_auth_method: "trust"
@@ -14,6 +18,7 @@ postgresql_default_auth_method: "trust"
14
18
  # The user/group that will run postgresql process or service
15
19
  postgresql_service_user: "{{ postgresql_admin_user }}"
16
20
  postgresql_service_group: "{{ postgresql_admin_user }}"
21
+ postgresql_service_enabled: true
17
22
 
18
23
  postgresql_cluster_name: "main"
19
24
  postgresql_cluster_reset: false
@@ -136,16 +141,15 @@ postgresql_shared_buffers: 128MB # min 128kB
136
141
  postgresql_huge_pages: try # on, off, or try
137
142
  postgresql_temp_buffers: 8MB # min 800kB
138
143
 
139
- # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
140
- # per transaction slot, plus lock space (see max_locks_per_transaction).
141
- # It is not advisable to set max_prepared_transactions nonzero unless you
142
- # actively intend to use prepared transactions.
144
+ # Caution: it is not advisable to set max_prepared_transactions nonzero unless
145
+ # you actively intend to use prepared transactions.
143
146
  postgresql_max_prepared_transactions: 0 # zero disables the feature
144
147
 
145
- postgresql_work_mem: 1MB # min 64kB
146
- postgresql_maintenance_work_mem: 16MB # min 1MB
147
- postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
148
- postgresql_max_stack_depth: 2MB # min 100kB
148
+ postgresql_work_mem: 1MB # min 64kB
149
+ postgresql_maintenance_work_mem: 16MB # min 1MB
150
+ postgresql_replacement_sort_tuples: 150000 # (>= 9.6) limits use of replacement selection sort
151
+ postgresql_autovacuum_work_mem: -1 # min 1MB, or -1 to use maintenance_work_mem
152
+ postgresql_max_stack_depth: 2MB # min 100kB
149
153
  postgresql_dynamic_shared_memory_type: posix # the default is the first option
150
154
  # supported by the operating system:
151
155
  # posix
@@ -157,7 +161,7 @@ postgresql_dynamic_shared_memory_type: posix # the default is the first optio
157
161
 
158
162
  # - Disk -
159
163
 
160
- # limits per-session temp file space in kB, or -1 for no limit (>= 9.2)
164
+ # limits per-process temp file space in kB, or -1 for no limit (>= 9.2)
161
165
  postgresql_temp_file_limit: -1
162
166
 
163
167
 
@@ -180,13 +184,19 @@ postgresql_vacuum_cost_limit: 200 # 1-10000 credits
180
184
 
181
185
  postgresql_bgwriter_delay: 200ms # 10-10000ms between rounds
182
186
  postgresql_bgwriter_lru_maxpages: 100 # 0-1000 max buffers written/round
183
- postgresql_bgwriter_lru_multiplier: 2.0 # 0-10.0 multipler on buffers scanned/round
187
+ postgresql_bgwriter_lru_multiplier: 2.0 # 0-10.0 multiplier on buffers scanned/round
188
+ postgresql_bgwriter_flush_after: 0 # (>= 9.6) 0 disables,
189
+ # default is 512kB on linux, 0 otherwise
184
190
 
185
191
 
186
192
  # - Asynchronous Behavior -
187
193
 
188
- postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
189
- postgresql_max_worker_processes: 8
194
+ postgresql_effective_io_concurrency: 1 # 1-1000; 0 disables prefetching
195
+ postgresql_max_worker_processes: 8 # (change requires restart)
196
+ postgresql_max_parallel_workers_per_gather: 0 # (>= 9.6) taken from max_worker_processes
197
+ postgresql_old_snapshot_threshold: -1 # (>= 9.6) 1min-60d; -1 disables; 0 is immediate
198
+ # (change requires restart)
199
+ postgresql_backend_flush_after: 0 # (>= 9.6) 0 disables, default is 0
190
200
 
191
201
 
192
202
  #------------------------------------------------------------------------------
@@ -195,15 +205,18 @@ postgresql_max_worker_processes: 8
195
205
 
196
206
  # - Settings -
197
207
 
198
- postgresql_wal_level: minimal # minimal, archive, hot_standby, or logical
199
- postgresql_fsync: on # turns forced synchronization on or off
208
+ postgresql_wal_level: minimal # minimal, archive (<= 9.5), hot_standby (<= 9.5), replica (>= 9.6), or logical
209
+ postgresql_fsync: on # flush data to disk for crash safety
210
+ # (turning this off can cause
211
+ # unrecoverable data corruption)
200
212
 
201
213
  # Synchronization level:
202
214
  # - off
203
215
  # - local
204
216
  # - remote_write
217
+ # - remote_apply (>= 9.6)
205
218
  # - on
206
- postgresql_synchronous_commit: on
219
+ postgresql_synchronous_commit: "on"
207
220
 
208
221
  # The default is the first option supported by the operating system:
209
222
  # - open_datasync
@@ -218,10 +231,11 @@ postgresql_full_page_writes: on
218
231
  postgresql_wal_compression: off # (>= 9.5)
219
232
  postgresql_wal_log_hints: off # also do full page writes of non-critical updates
220
233
 
221
- postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
222
- postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
223
- postgresql_commit_delay: 0 # range 0-100000, in microseconds
224
- postgresql_commit_siblings: 5 # range 1-1000
234
+ postgresql_wal_buffers: -1 # min 32kB, -1 sets based on shared_buffers
235
+ postgresql_wal_writer_delay: 200ms # 1-10000 milliseconds
236
+ postgresql_wal_writer_flush_after: 1MB # (>= 9.6) 0 disables
237
+ postgresql_commit_delay: 0 # range 0-100000, in microseconds
238
+ postgresql_commit_siblings: 5 # range 1-1000
225
239
 
226
240
 
227
241
  # - Checkpoints -
@@ -229,7 +243,9 @@ postgresql_commit_siblings: 5 # range 1-1000
229
243
  postgresql_checkpoint_segments: 3 # (<= 9.4) in logfile segments, min 1, 16MB each
230
244
  postgresql_max_wal_size: 1GB # (>= 9.5)
231
245
  postgresql_min_wal_size: 80MB # (>= 9.5)
232
- postgresql_checkpoint_timeout: 5min # range 30s-1h
246
+ postgresql_checkpoint_flush_after: 0 # (>= 9.6) 0 disables,
247
+ # default is 256kB on linux, 0 otherwise
248
+ postgresql_checkpoint_timeout: 5min # range 30s-1d
233
249
  postgresql_checkpoint_completion_target: 0.5 # checkpoint target duration, 0.0 - 1.0
234
250
  postgresql_checkpoint_warning: 30s # 0 disables
235
251
 
@@ -272,8 +288,9 @@ postgresql_track_commit_timestamp: off # (>= 9.5)
272
288
 
273
289
  # These settings are ignored on a standby server.
274
290
 
275
- # Standby servers that provide sync rep.
276
- # Comma-separated list of application_name from standby(s)
291
+ # standby servers that provide sync rep.
292
+ # number of sync standbys (>= 9.6) and comma-separated list of application_name from standby(s)
293
+ postgresql_synchronous_standby_num_sync: ''
277
294
  postgresql_synchronous_standby_names: [] # '*' means 'all'
278
295
 
279
296
  # number of xacts by which cleanup is delayed
@@ -303,47 +320,51 @@ postgresql_wal_retrieve_retry_interval: 5s # (>= 9.5)
303
320
 
304
321
  # - Planner Method Configuration -
305
322
 
306
- postgresql_enable_bitmapscan: on
307
- postgresql_enable_hashagg: on
308
- postgresql_enable_hashjoin: on
309
- postgresql_enable_indexscan: on
310
- postgresql_enable_indexonlyscan: on
311
- postgresql_enable_material: on
312
- postgresql_enable_mergejoin: on
313
- postgresql_enable_nestloop: on
314
- postgresql_enable_seqscan: on
315
- postgresql_enable_sort: on
316
- postgresql_enable_tidscan: on
323
+ postgresql_enable_bitmapscan: on
324
+ postgresql_enable_hashagg: on
325
+ postgresql_enable_hashjoin: on
326
+ postgresql_enable_indexscan: on
327
+ postgresql_enable_indexonlyscan: on
328
+ postgresql_enable_material: on
329
+ postgresql_enable_mergejoin: on
330
+ postgresql_enable_nestloop: on
331
+ postgresql_enable_seqscan: on
332
+ postgresql_enable_sort: on
333
+ postgresql_enable_tidscan: on
317
334
 
318
335
 
319
336
  # - Planner Cost Constants -
320
337
 
321
- postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
322
- postgresql_random_page_cost: 4.0 # same scale as above
323
- postgresql_cpu_tuple_cost: 0.01 # same scale as above
324
- postgresql_cpu_index_tuple_cost: 0.005 # same scale as above
325
- postgresql_cpu_operator_cost: 0.0025 # same scale as above
326
- postgresql_effective_cache_size: 128MB
338
+ postgresql_seq_page_cost: 1.0 # measured on an arbitrary scale
339
+ postgresql_random_page_cost: 4.0 # same scale as above
340
+ postgresql_cpu_tuple_cost: 0.01 # same scale as above
341
+ postgresql_cpu_index_tuple_cost: 0.005 # same scale as above
342
+ postgresql_cpu_operator_cost: 0.0025 # same scale as above
343
+ postgresql_parallel_tuple_cost: 0.1 # same scale as above (>= 9.6)
344
+ postgresql_parallel_setup_cost: 1000.0 # same scale as above (>= 9.6)
345
+ postgresql_min_parallel_relation_size: 8MB # (>= 9.6)
346
+ postgresql_effective_cache_size: 128MB
327
347
 
328
348
 
329
349
  # - Genetic Query Optimizer -
330
350
 
331
- postgresql_geqo: on
332
- postgresql_geqo_threshold: 12
333
- postgresql_geqo_effort: 5 # range 1-10
334
- postgresql_geqo_pool_size: 0 # selects default based on effort
335
- postgresql_geqo_generations: 0 # selects default based on effort
336
- postgresql_geqo_selection_bias: 2.0 # range 1.5-2.0
337
- postgresql_geqo_seed: 0.0 # range 0.0-1.0
351
+ postgresql_geqo: on
352
+ postgresql_geqo_threshold: 12
353
+ postgresql_geqo_effort: 5 # range 1-10
354
+ postgresql_geqo_pool_size: 0 # selects default based on effort
355
+ postgresql_geqo_generations: 0 # selects default based on effort
356
+ postgresql_geqo_selection_bias: 2.0 # range 1.5-2.0
357
+ postgresql_geqo_seed: 0.0 # range 0.0-1.0
338
358
 
339
359
 
340
360
  # - Other Planner Options -
341
361
 
342
- postgresql_default_statistics_target: 100 # range 1-10000
343
- postgresql_constraint_exclusion: partition # on, off, or partition
344
- postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
345
- postgresql_from_collapse_limit: 8
346
- postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
362
+ postgresql_default_statistics_target: 100 # range 1-10000
363
+ postgresql_constraint_exclusion: partition # on, off, or partition
364
+ postgresql_cursor_tuple_fraction: 0.1 # range 0.0-1.0
365
+ postgresql_from_collapse_limit: 8
366
+ postgresql_join_collapse_limit: 8 # 1 disables collapsing of explicit
367
+ postgresql_force_parallel_mode: off # (>= 9.6)
347
368
 
348
369
 
349
370
  #------------------------------------------------------------------------------
@@ -354,34 +375,36 @@ postgresql_join_collapse_limit: 8 # 1 disables collapsing of expl
354
375
 
355
376
  # Valid values are combinations of stderr, csvlog, syslog, and eventlog.
356
377
  # depending on platform. Csvlog requires logging_collector to be on.
357
- postgresql_log_destination: stderr
378
+ postgresql_log_destination: stderr
358
379
 
359
380
  # Enable capturing of stderr and csvlog into log files.
360
381
  # Required to be on for csvlogs.
361
- postgresql_logging_collector: off
382
+ postgresql_logging_collector: off
362
383
 
363
384
  # These are only used if logging_collector is on:
364
385
 
365
386
  # Directory where log files are written, can be absolute or relative to PGDATA
366
- postgresql_log_directory: pg_log
387
+ postgresql_log_directory: pg_log
367
388
  # Log file name pattern, can include strftime() escapes
368
- postgresql_log_filename: postgresql-%Y-%m-%d_%H%M%S.log
369
- postgresql_log_file_mode: '0600' # begin with 0 to use octal notation
389
+ postgresql_log_filename: postgresql-%Y-%m-%d_%H%M%S.log
390
+ postgresql_log_file_mode: '0600' # begin with 0 to use octal notation
370
391
  # If on, an existing log file with the same name as the new log file will be
371
392
  # truncated rather than appended to. But such truncation only occurs on
372
393
  # time-driven rotation, not on restarts or size-driven rotation. Default is
373
394
  # off, meaning append to existing files in all cases.
374
- postgresql_log_truncate_on_rotation: off
395
+ postgresql_log_truncate_on_rotation: off
375
396
  # Automatic rotation of logfiles will happen after that time.
376
- postgresql_log_rotation_age: 1d
397
+ postgresql_log_rotation_age: 1d
377
398
  # Automatic rotation of logfiles will happen after that much log output.
378
- postgresql_log_rotation_size: 10MB
399
+ postgresql_log_rotation_size: 10MB
379
400
 
380
401
  # These are relevant when logging to syslog:
381
- postgresql_syslog_facility: LOCAL0
382
- postgresql_syslog_ident: postgres
402
+ postgresql_syslog_facility: LOCAL0
403
+ postgresql_syslog_ident: postgres
404
+ postgresql_syslog_sequence_numbers: on # (>= 9.6)
405
+ postgresql_syslog_split_messages: on # (>= 9.6)
383
406
  # This is only relevant when logging to eventlog (win32) (>= 9.2):
384
- postgresql_event_source: PostgreSQL
407
+ postgresql_event_source: PostgreSQL
385
408
 
386
409
 
387
410
  # - When to Log -
@@ -455,6 +478,7 @@ postgresql_log_hostname: off
455
478
  # %p = process ID
456
479
  # %t = timestamp without milliseconds
457
480
  # %m = timestamp with milliseconds
481
+ # %n = timestamp with milliseconds (as a Unix epoch)
458
482
  # %i = command tag
459
483
  # %e = SQL state
460
484
  # %c = session ID
@@ -547,12 +571,13 @@ postgresql_default_transaction_read_only: off
547
571
  postgresql_default_transaction_deferrable: off
548
572
  postgresql_session_replication_role: origin
549
573
 
550
- postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled
551
- postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3)
552
- postgresql_vacuum_freeze_min_age: 50000000
553
- postgresql_vacuum_freeze_table_age: 150000000
554
- postgresql_vacuum_multixact_freeze_min_age: 5000000 # (>= 9.3)
555
- postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3)
574
+ postgresql_statement_timeout: 0 # in milliseconds, 0 is disabled
575
+ postgresql_lock_timeout: 0 # in milliseconds, 0 is disabled (>= 9.3)
576
+ postgresql_idle_in_transaction_session_timeout: 0 # in milliseconds, 0 is disabled (>= 9.6)
577
+ postgresql_vacuum_freeze_min_age: 50000000
578
+ postgresql_vacuum_freeze_table_age: 150000000
579
+ postgresql_vacuum_multixact_freeze_min_age: 5000000 # (>= 9.3)
580
+ postgresql_vacuum_multixact_freeze_table_age: 150000000 # (>= 9.3)
556
581
 
557
582
  postgresql_bytea_output: hex # hex, escape
558
583
  postgresql_xmlbinary: base64
@@ -669,6 +694,45 @@ postgresql_apt_repository: 'deb http://apt.postgresql.org/pub/repos/apt/ {{ansib
669
694
  postgresql_apt_pin_priority: 500
670
695
 
671
696
  # Yum settings
697
+ postgresql_pgdg_dists:
698
+ RedHat: redhat
699
+ CentOS: centos
700
+ Scientific: sl
701
+ SLC: sl
702
+ OracleLinux: oraclelinux
703
+ postgresql_pgdg_releases:
704
+ redhat: {
705
+ 9.1: 8,
706
+ 9.2: 9,
707
+ 9.3: 3,
708
+ 9.4: 3,
709
+ 9.5: 3,
710
+ 9.6: 3,
711
+ }
712
+ centos: {
713
+ 9.1: 7,
714
+ 9.2: 8,
715
+ 9.3: 3,
716
+ 9.4: 3,
717
+ 9.5: 3,
718
+ 9.6: 3,
719
+ }
720
+ sl: {
721
+ 9.1: 8,
722
+ 9.2: 9,
723
+ 9.3: 3,
724
+ 9.4: 3,
725
+ 9.5: 3,
726
+ 9.6: 3,
727
+ }
728
+ oraclelinux: {
729
+ 9.1: 8,
730
+ 9.2: 9,
731
+ 9.3: 3,
732
+ 9.4: 3,
733
+ 9.5: 3,
734
+ 9.6: 3,
735
+ }
672
736
  postgresql_version_terse: "{{ postgresql_version | replace('.', '') }}"
673
737
  postgresql_yum_repository_base_url: "http://yum.postgresql.org"
674
- postgresql_yum_repository_url: "{{ postgresql_yum_repository_base_url }}/{{ postgresql_version }}/{{ ansible_os_family | lower }}/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}/pgdg-{{ ansible_distribution | lower }}{{ postgresql_version_terse }}-{{ postgresql_version }}-2.noarch.rpm"
738
+ postgresql_yum_repository_url: "{{ postgresql_yum_repository_base_url }}/{{ postgresql_version }}/{{ ansible_os_family | lower }}/rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}/pgdg-{{ postgresql_pgdg_dists[ansible_distribution] }}{{ postgresql_version_terse }}-{{ postgresql_version }}-{{ postgresql_pgdg_releases.get(postgresql_pgdg_dists[ansible_distribution]).get(postgresql_version) }}.noarch.rpm"
@@ -1 +1 @@
1
- {install_date: 'Thu Jan 5 14:34:14 2017', version: v1.6.2}
1
+ {install_date: 'Mon Mar 6 20:23:05 2017', version: v1.7.1}
@@ -16,17 +16,21 @@
16
16
  mode: 0700
17
17
  register: pgdata_dir_exist
18
18
 
19
- - name: PostgreSQL | Ensure the locale is generated | Debian
19
+ - name: PostgreSQL | Ensure the locale for lc_collate and lc_ctype is generated | Debian
20
20
  become: yes
21
- locale_gen: name="{{ postgresql_locale }}" state=present
21
+ locale_gen: name="{{ item }}" state=present
22
+ with_items:
23
+ - "{{ postgresql_locale }}"
24
+ - "{{ postgresql_ctype }}"
22
25
  when: ansible_os_family == "Debian"
23
26
 
24
27
  - name: PostgreSQL | Ensure the locale is generated | RedHat
25
28
  become: yes
26
- command: >
27
- localedef -c -i {{ postgresql_locale_parts[0] }} -f {{ postgresql_locale_parts[1] }}
28
- {{ postgresql_locale }}
29
+ command: localedef -c -i {{ item.parts[0] }} -f {{ item.parts[1] }} {{ item.locale_name }}
29
30
  changed_when: false
31
+ with_items:
32
+ - { parts: "{{ postgresql_locale_parts }}", locale_name: "{{ postgresql_locale }}" }
33
+ - { parts: "{{ postgresql_ctype_parts }}", locale_name: "{{ postgresql_ctype }}" }
30
34
  when: ansible_os_family == "RedHat"
31
35
 
32
36
  - name: PostgreSQL | Reset the cluster - drop the existing one | Debian
@@ -148,6 +152,12 @@
148
152
  group: "{{ postgresql_service_group }}"
149
153
  mode: u=rwX,g=rwXs,o=rx
150
154
 
155
+ - name: PostgreSQL | Enable service
156
+ service:
157
+ name: "{{ postgresql_service_name }}"
158
+ enabled: yes
159
+ when: "{{ postgresql_service_enabled | bool }}"
160
+
151
161
  - name: PostgreSQL | Restart PostgreSQL
152
162
  service:
153
163
  name: "{{ postgresql_service_name }}"
@@ -9,9 +9,9 @@
9
9
  postgresql_db:
10
10
  name: "{{item.name}}"
11
11
  owner: "{{ item.owner | default(postgresql_database_owner) }}"
12
- encoding: "{{postgresql_encoding}}"
13
- lc_collate: "{{postgresql_locale}}"
14
- lc_ctype: "{{postgresql_locale}}"
12
+ encoding: "{{ item.encoding | default(postgresql_encoding) }}"
13
+ lc_collate: "{{ item.lc_collate | default(postgresql_locale) }}"
14
+ lc_ctype: "{{ item.lc_ctype | default(postgresql_ctype) }}"
15
15
  port: "{{postgresql_port}}"
16
16
  template: "template0"
17
17
  state: present
@@ -1,10 +1,20 @@
1
1
  # file: postgresql/tasks/extensions/dev_headers.yml
2
2
 
3
- - name: PostgreSQL | Extensions | Make sure the development headers are installed
3
+ - name: PostgreSQL | Extensions | Make sure the development headers are installed | Debian
4
4
  apt:
5
5
  name: libpq-dev
6
6
  state: present
7
7
  update_cache: yes
8
8
  cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
9
+ when: ansible_os_family == "Debian"
10
+ notify:
11
+ - restart postgresql
12
+
13
+ - name: PostgreSQL | Extensions | Make sure the development headers are installed | RedHat
14
+ yum: "name={{ item }} state=present update_cache=yes"
15
+ with_items:
16
+ - "postgresql{{ postgresql_version_terse }}-libs"
17
+ - "postgresql{{ postgresql_version_terse }}-devel"
18
+ when: ansible_os_family == "RedHat"
9
19
  notify:
10
20
  - restart postgresql
@@ -18,7 +18,7 @@
18
18
  apt_repository:
19
19
  repo: "{{ postgresql_apt_repository }}"
20
20
  state: present
21
- when: postgresql_apt_repository
21
+ when: postgresql_apt_repository | default('') != ''
22
22
 
23
23
  - name: PostgreSQL | Add PostgreSQL repository preferences
24
24
  template: