syncwrap 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.rdoc +29 -0
- data/Manifest.txt +7 -10
- data/examples/jruby.rb +1 -1
- data/lib/syncwrap/amazon_ws.rb +12 -2
- data/lib/syncwrap/base.rb +1 -1
- data/lib/syncwrap/component.rb +4 -0
- data/lib/syncwrap/components/cruby_vm.rb +2 -2
- data/lib/syncwrap/components/hashdot.rb +12 -2
- data/lib/syncwrap/components/jruby_vm.rb +2 -2
- data/lib/syncwrap/components/postgresql.rb +164 -44
- data/lib/syncwrap/components/rhel.rb +10 -8
- data/lib/syncwrap/components/run_user.rb +4 -4
- data/lib/syncwrap/components/ubuntu.rb +11 -9
- data/lib/syncwrap/distro.rb +3 -16
- data/lib/syncwrap/git_help.rb +3 -3
- data/lib/syncwrap/shell.rb +16 -10
- data/sync/etc/sysctl.d/{61-postgresql-shm.conf → 61-postgresql-shm.conf.erb} +1 -1
- data/sync/postgresql/{ubuntu/pg_hba.conf → pg_hba.conf.erb} +15 -3
- data/sync/postgresql/{rhel/postgresql.conf → postgresql.conf.erb} +68 -17
- data/test/test_shell.rb +58 -0
- data/test/test_space_main.rb +1 -1
- metadata +11 -28
- data/sync/postgresql/rhel/pg_hba.conf +0 -87
- data/sync/postgresql/ubuntu/pg_ident.conf +0 -42
- data/sync/postgresql/ubuntu/postgresql.conf +0 -540
- /data/sync/postgresql/{ubuntu/environment → environment} +0 -0
- /data/sync/postgresql/{ubuntu/pg_ctl.conf → pg_ctl.conf} +0 -0
- /data/sync/postgresql/{rhel/pg_ident.conf → pg_ident.conf} +0 -0
- /data/sync/postgresql/{ubuntu/start.conf → start.conf} +0 -0
data/lib/syncwrap/distro.rb
CHANGED
@@ -25,13 +25,8 @@ module SyncWrap
|
|
25
25
|
# (default: /usr/local)
|
26
26
|
attr_accessor :local_root
|
27
27
|
|
28
|
-
# A Hash of internal/common package names to distro specific package
|
29
|
-
# names.
|
30
|
-
attr_reader :packages_map
|
31
|
-
|
32
28
|
def initialize( *args )
|
33
29
|
@local_root = '/usr/local'
|
34
|
-
@packages_map = {}
|
35
30
|
|
36
31
|
super( *args )
|
37
32
|
end
|
@@ -41,15 +36,8 @@ module SyncWrap
|
|
41
36
|
self
|
42
37
|
end
|
43
38
|
|
44
|
-
#
|
45
|
-
#
|
46
|
-
def dist_map_packages( *pkgs )
|
47
|
-
pkgs.flatten.compact.map { |pkg| packages_map[ pkg ] || pkg }
|
48
|
-
end
|
49
|
-
|
50
|
-
# Install the specified packages using distro-specific mapped
|
51
|
-
# package names. A trailing hash is interpreted as options, see
|
52
|
-
# below.
|
39
|
+
# Install the specified package names. A trailing hash is
|
40
|
+
# interpreted as options, see below.
|
53
41
|
#
|
54
42
|
# ==== Options
|
55
43
|
#
|
@@ -61,8 +49,7 @@ module SyncWrap
|
|
61
49
|
raise "Include a distro-specific component, e.g. Ubuntu, RHEL"
|
62
50
|
end
|
63
51
|
|
64
|
-
# Uninstall specified
|
65
|
-
# package names and command.
|
52
|
+
# Uninstall the specified package names.
|
66
53
|
def dist_uninstall( *pkgs )
|
67
54
|
raise "Include a distro-specific component, e.g. Ubuntu, RHEL"
|
68
55
|
end
|
data/lib/syncwrap/git_help.rb
CHANGED
@@ -35,13 +35,13 @@ module SyncWrap
|
|
35
35
|
|
36
36
|
# Return the abbreviated SHA-1 hash for the last git commit at
|
37
37
|
# path
|
38
|
-
def self.
|
38
|
+
def self.git_hash( path = nil )
|
39
39
|
path ||= caller_path( caller )
|
40
40
|
`cd #{path} && git log -n 1 --format='format:%h'`
|
41
41
|
end
|
42
42
|
|
43
43
|
# Return a lambda that will #require_clean! for callers path
|
44
|
-
# before providing #
|
44
|
+
# before providing #git_hash. Use this for cases where you only want
|
45
45
|
# to use a git hash when it is an accurate reflection of the local
|
46
46
|
# file state. Since the test is deferred, it will only be required
|
47
47
|
# for actions (i.e. image creation, etc.) that actually use it.
|
@@ -49,7 +49,7 @@ module SyncWrap
|
|
49
49
|
cpath = caller_path( caller )
|
50
50
|
lambda do
|
51
51
|
require_clean!( cpath )
|
52
|
-
|
52
|
+
git_hash( cpath )
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
data/lib/syncwrap/shell.rb
CHANGED
@@ -24,19 +24,20 @@ module SyncWrap
|
|
24
24
|
|
25
25
|
# Low level command construction and process output capture.
|
26
26
|
#
|
27
|
-
# == Supported
|
27
|
+
# == Supported Command Forms
|
28
28
|
#
|
29
|
-
#
|
30
|
-
# bash
|
31
|
-
# sudo
|
29
|
+
# LOCAL:
|
30
|
+
# bash BASH_FLAGS -c COMMANDS
|
31
|
+
# sudo SUDO_FLAGS bash BASH_FLAGS -c COMMANDS
|
32
32
|
#
|
33
|
-
#
|
34
|
-
# ssh
|
35
|
-
# ssh
|
33
|
+
# REMOTE:
|
34
|
+
# ssh SSH_FLAGS HOST bash BASH_FLAGS -c "COMMANDS" [1>&2]
|
35
|
+
# ssh SSH_FLAGS HOST sudo SUDO_FLAGS bash BASH_FLAGS -c "COMMANDS" [1>&2]
|
36
36
|
#
|
37
|
-
#
|
37
|
+
# BASH_FLAGS: [-v|-x] [-e] [-o pipefail] [-n]
|
38
|
+
# SUDO_FLAGS: [-u :user] :sudo_flags ...
|
39
|
+
# SSH_FLAGS: [-l :ssh_user] [-i :ssh_user_pem] :ssh_flags ...
|
38
40
|
#
|
39
|
-
# Example sudo_flags: -H
|
40
41
|
module Shell
|
41
42
|
|
42
43
|
private
|
@@ -87,7 +88,12 @@ module SyncWrap
|
|
87
88
|
# passed to #commmand_lines_cleanup.
|
88
89
|
def sh_args( command, opts = {} ) # :doc:
|
89
90
|
args = [ 'bash' ]
|
90
|
-
|
91
|
+
if opts[ :error ].nil? || opts[ :error ]
|
92
|
+
args << '-e'
|
93
|
+
args += %w[ -o pipefail ] unless opts[ :pipefail ] == false
|
94
|
+
else
|
95
|
+
args += %w[ -o pipefail ] if opts[ :pipefail ]
|
96
|
+
end
|
91
97
|
args << '-n' if opts[ :dryrun ]
|
92
98
|
|
93
99
|
if opts[ :coalesce ]
|
@@ -84,11 +84,23 @@ local all postgres peer
|
|
84
84
|
# TYPE DATABASE USER ADDRESS METHOD
|
85
85
|
|
86
86
|
# "local" is for Unix domain socket connections only
|
87
|
-
local all all
|
87
|
+
local all all <%= local_access %>
|
88
|
+
<% if local_network_access %>
|
88
89
|
# IPv4 local connections:
|
89
|
-
host all all 127.0.0.1/32
|
90
|
+
host all all 127.0.0.1/32 <%= local_network_access %>
|
90
91
|
# IPv6 local connections:
|
91
|
-
host all all ::1/128
|
92
|
+
host all all ::1/128 <%= local_network_access %>
|
93
|
+
<% end %>
|
94
|
+
<% if network_access %>
|
95
|
+
<% if network_v4_mask %>
|
96
|
+
# IPv4 network connections:
|
97
|
+
host all all <%=network_v4_mask%> <%= network_access %>
|
98
|
+
<% end %>
|
99
|
+
<% if network_v6_mask %>
|
100
|
+
# IPv6 network connections:
|
101
|
+
host all all <%=network_v6_mask%> <%= network_access %>
|
102
|
+
<% end %>
|
103
|
+
<% end %>
|
92
104
|
# Allow replication connections from localhost, by a user with the
|
93
105
|
# replication privilege.
|
94
106
|
#local replication postgres peer
|
@@ -37,6 +37,22 @@
|
|
37
37
|
# The default values of these variables are driven from the -D command-line
|
38
38
|
# option or PGDATA environment variable, represented here as ConfigDir.
|
39
39
|
|
40
|
+
<% if pg_specify_etc_config %>
|
41
|
+
data_directory = '/var/lib/postgresql/<%= version %>/main'
|
42
|
+
# use data in another directory
|
43
|
+
# (change requires restart)
|
44
|
+
hba_file = '/etc/postgresql/<%= version %>/main/pg_hba.conf'
|
45
|
+
# host-based authentication file
|
46
|
+
# (change requires restart)
|
47
|
+
ident_file = '/etc/postgresql/<%= version %>/main/pg_ident.conf'
|
48
|
+
# ident configuration file
|
49
|
+
# (change requires restart)
|
50
|
+
|
51
|
+
# If external_pid_file is not explicitly set, no extra PID file is written.
|
52
|
+
external_pid_file = '/var/run/postgresql/<%= version %>-main.pid'
|
53
|
+
# write an extra PID file
|
54
|
+
# (change requires restart)
|
55
|
+
<% else %>
|
40
56
|
#data_directory = 'ConfigDir' # use data in another directory
|
41
57
|
# (change requires restart)
|
42
58
|
#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
|
@@ -47,6 +63,7 @@
|
|
47
63
|
# If external_pid_file is not explicitly set, no extra PID file is written.
|
48
64
|
#external_pid_file = '' # write an extra PID file
|
49
65
|
# (change requires restart)
|
66
|
+
<% end %>
|
50
67
|
|
51
68
|
#------------------------------------------------------------------------------
|
52
69
|
# CONNECTIONS AND AUTHENTICATION
|
@@ -54,18 +71,23 @@
|
|
54
71
|
|
55
72
|
# - Connection Settings -
|
56
73
|
|
74
|
+
<% if network_access %>
|
75
|
+
listen_addresses = '*'
|
76
|
+
<% end %>
|
57
77
|
#listen_addresses = 'localhost' # what IP address(es) to listen on;
|
58
78
|
# comma-separated list of addresses;
|
59
79
|
# defaults to 'localhost'; use '*' for all
|
60
80
|
# (change requires restart)
|
61
81
|
#port = 5432 # (change requires restart)
|
62
|
-
# Note: In RHEL
|
82
|
+
# Note: In RHEL-like installations, you can't set the port number here;
|
63
83
|
# adjust it in the service file instead.
|
64
84
|
max_connections = 100 # (change requires restart)
|
65
85
|
# Note: Increasing max_connections costs ~400 bytes of shared memory per
|
66
86
|
# connection slot, plus lock space (see max_locks_per_transaction).
|
67
87
|
#superuser_reserved_connections = 3 # (change requires restart)
|
68
|
-
#
|
88
|
+
#unix_socket_directory = '/var/run/postgresql' # < 9.3
|
89
|
+
#unix_socket_directories = '/var/run/postgresql, /tmp'
|
90
|
+
# comma-separated list of directories (9.3)
|
69
91
|
# (change requires restart)
|
70
92
|
#unix_socket_group = '' # (change requires restart)
|
71
93
|
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
|
@@ -79,7 +101,7 @@ max_connections = 100 # (change requires restart)
|
|
79
101
|
|
80
102
|
#authentication_timeout = 1min # 1s-600s
|
81
103
|
#ssl = off # (change requires restart)
|
82
|
-
#ssl_ciphers = '
|
104
|
+
#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
|
83
105
|
# (change requires restart)
|
84
106
|
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations
|
85
107
|
#ssl_cert_file = 'server.crt' # (change requires restart)
|
@@ -110,7 +132,7 @@ max_connections = 100 # (change requires restart)
|
|
110
132
|
|
111
133
|
# - Memory -
|
112
134
|
|
113
|
-
shared_buffers =
|
135
|
+
shared_buffers = <%= shared_buffers %> # min 128kB
|
114
136
|
# (change requires restart)
|
115
137
|
#temp_buffers = 8MB # min 800kB
|
116
138
|
#max_prepared_transactions = 0 # zero disables the feature
|
@@ -119,9 +141,14 @@ shared_buffers = 256MB # min 128kB
|
|
119
141
|
# per transaction slot, plus lock space (see max_locks_per_transaction).
|
120
142
|
# It is not advisable to set max_prepared_transactions nonzero unless you
|
121
143
|
# actively intend to use prepared transactions.
|
122
|
-
work_mem =
|
123
|
-
maintenance_work_mem =
|
124
|
-
max_stack_depth =
|
144
|
+
work_mem = <%= work_mem %> # min 64kB
|
145
|
+
maintenance_work_mem = <%= maintenance_work_mem %> # min 1MB
|
146
|
+
max_stack_depth = <%= max_stack_depth %> # min 100kB
|
147
|
+
|
148
|
+
# - Disk -
|
149
|
+
|
150
|
+
#temp_file_limit = -1 # limits per-session temp file space
|
151
|
+
# in kB, or -1 for no limit
|
125
152
|
|
126
153
|
# - Kernel Resource Usage -
|
127
154
|
|
@@ -131,7 +158,7 @@ max_stack_depth = 4MB # min 100kB
|
|
131
158
|
|
132
159
|
# - Cost-Based Vacuum Delay -
|
133
160
|
|
134
|
-
#vacuum_cost_delay =
|
161
|
+
#vacuum_cost_delay = 0 # 0-100 milliseconds
|
135
162
|
#vacuum_cost_page_hit = 1 # 0-10000 credits
|
136
163
|
#vacuum_cost_page_miss = 10 # 0-10000 credits
|
137
164
|
#vacuum_cost_page_dirty = 20 # 0-10000 credits
|
@@ -145,7 +172,8 @@ max_stack_depth = 4MB # min 100kB
|
|
145
172
|
|
146
173
|
# - Asynchronous Behavior -
|
147
174
|
|
148
|
-
effective_io_concurrency =
|
175
|
+
effective_io_concurrency = <%= effective_io_concurrency %>
|
176
|
+
# 1-1000. 0 disables prefetching
|
149
177
|
|
150
178
|
#------------------------------------------------------------------------------
|
151
179
|
# WRITE AHEAD LOG
|
@@ -156,7 +184,8 @@ effective_io_concurrency = 4 # 1-1000. 0 disables prefetching
|
|
156
184
|
#wal_level = minimal # minimal, archive, or hot_standby
|
157
185
|
# (change requires restart)
|
158
186
|
#fsync = on # turns forced synchronization on or off
|
159
|
-
synchronous_commit =
|
187
|
+
synchronous_commit = <%= synchronous_commit %> # synchronization level;
|
188
|
+
# off, local, remote_write, or on
|
160
189
|
#wal_sync_method = fsync # the default is the first option
|
161
190
|
# supported by the operating system:
|
162
191
|
# open_datasync
|
@@ -169,12 +198,12 @@ synchronous_commit = off # synchronization level; on, off, or loc
|
|
169
198
|
# (change requires restart)
|
170
199
|
#wal_writer_delay = 200ms # 1-10000 milliseconds
|
171
200
|
|
172
|
-
commit_delay =
|
201
|
+
commit_delay = <%= commit_delay %> # range 0-100000, in microseconds
|
173
202
|
#commit_siblings = 5 # range 1-1000
|
174
203
|
|
175
204
|
# - Checkpoints -
|
176
205
|
|
177
|
-
checkpoint_segments =
|
206
|
+
checkpoint_segments = <%= checkpoint_segments %> # in logfile segments (16MB each)
|
178
207
|
#checkpoint_timeout = 5min # range 30s-1h
|
179
208
|
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
|
180
209
|
#checkpoint_warning = 30s # 0 disables
|
@@ -194,14 +223,15 @@ checkpoint_segments = 16 # in logfile segments, min 1, 16MB each
|
|
194
223
|
# REPLICATION
|
195
224
|
#------------------------------------------------------------------------------
|
196
225
|
|
197
|
-
# -
|
226
|
+
# - Sending Server(s) -
|
198
227
|
|
199
228
|
# Set these on the master and on any standby that will send replication data.
|
200
229
|
|
201
230
|
#max_wal_senders = 0 # max number of walsender processes
|
202
231
|
# (change requires restart)
|
203
232
|
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
|
204
|
-
#replication_timeout = 60s #
|
233
|
+
#replication_timeout = 60s # < 9.3
|
234
|
+
#wal_sender_timeout = 60s # in milliseconds; 0 disables (9.3)
|
205
235
|
|
206
236
|
# - Master Server -
|
207
237
|
|
@@ -228,6 +258,9 @@ checkpoint_segments = 16 # in logfile segments, min 1, 16MB each
|
|
228
258
|
# 0 disables
|
229
259
|
#hot_standby_feedback = off # send info from standby to prevent
|
230
260
|
# query conflicts
|
261
|
+
#wal_receiver_timeout = 60s # time that receiver waits for
|
262
|
+
# communication from master
|
263
|
+
# in milliseconds; 0 disables
|
231
264
|
|
232
265
|
#------------------------------------------------------------------------------
|
233
266
|
# QUERY TUNING
|
@@ -281,7 +314,7 @@ checkpoint_segments = 16 # in logfile segments, min 1, 16MB each
|
|
281
314
|
|
282
315
|
# - Where to Log -
|
283
316
|
|
284
|
-
|
317
|
+
log_destination = 'stderr' # Valid values are combinations of
|
285
318
|
# stderr, csvlog, syslog, and eventlog,
|
286
319
|
# depending on platform. csvlog
|
287
320
|
# requires logging_collector to be on.
|
@@ -293,7 +326,7 @@ logging_collector = on # Enable capturing of stderr and csvlog
|
|
293
326
|
# (change requires restart)
|
294
327
|
|
295
328
|
# These are only used if logging_collector is on:
|
296
|
-
|
329
|
+
log_directory = 'pg_log' # directory where log files are written,
|
297
330
|
# can be absolute or relative to PGDATA
|
298
331
|
log_filename = 'postgresql-%a.log' # log file name pattern,
|
299
332
|
# can include strftime() escapes
|
@@ -378,7 +411,7 @@ log_rotation_size = 0 # Automatic rotation of logfiles will
|
|
378
411
|
#log_duration = off
|
379
412
|
#log_error_verbosity = default # terse, default, or verbose messages
|
380
413
|
#log_hostname = off
|
381
|
-
log_line_prefix = '%
|
414
|
+
log_line_prefix = '< %m >' # special values:
|
382
415
|
# %a = application name
|
383
416
|
# %u = user name
|
384
417
|
# %d = database name
|
@@ -447,6 +480,9 @@ log_timezone = 'UTC'
|
|
447
480
|
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
|
448
481
|
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
|
449
482
|
# (change requires restart)
|
483
|
+
#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age
|
484
|
+
# before forced vacuum
|
485
|
+
# (change requires restart)
|
450
486
|
#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
|
451
487
|
# autovacuum, in milliseconds;
|
452
488
|
# -1 means use vacuum_cost_delay
|
@@ -470,8 +506,11 @@ log_timezone = 'UTC'
|
|
470
506
|
#default_transaction_deferrable = off
|
471
507
|
#session_replication_role = 'origin'
|
472
508
|
#statement_timeout = 0 # in milliseconds, 0 is disabled
|
509
|
+
#lock_timeout = 0 # in milliseconds, 0 is disabled
|
473
510
|
#vacuum_freeze_min_age = 50000000
|
474
511
|
#vacuum_freeze_table_age = 150000000
|
512
|
+
#vacuum_multixact_freeze_min_age = 5000000
|
513
|
+
#vacuum_multixact_freeze_table_age = 150000000
|
475
514
|
#bytea_output = 'hex' # hex, escape
|
476
515
|
#xmlbinary = 'base64'
|
477
516
|
#xmloption = 'content'
|
@@ -547,6 +586,18 @@ default_text_search_config = 'pg_catalog.english'
|
|
547
586
|
#exit_on_error = off # terminate session on any error?
|
548
587
|
#restart_after_crash = on # reinitialize after backend crash?
|
549
588
|
|
589
|
+
#------------------------------------------------------------------------------
|
590
|
+
# CONFIG FILE INCLUDES
|
591
|
+
#------------------------------------------------------------------------------
|
592
|
+
|
593
|
+
# These options allow settings to be loaded from files other than the
|
594
|
+
# default postgresql.conf.
|
595
|
+
|
596
|
+
#include_dir = 'conf.d' # include files ending in '.conf' from
|
597
|
+
# directory 'conf.d'
|
598
|
+
#include_if_exists = 'exists.conf' # include file only if it exists
|
599
|
+
#include = 'special.conf' # include file
|
600
|
+
|
550
601
|
#------------------------------------------------------------------------------
|
551
602
|
# CUSTOMIZED OPTIONS
|
552
603
|
#------------------------------------------------------------------------------
|
data/test/test_shell.rb
CHANGED
@@ -132,6 +132,52 @@ class TestShell < MiniTest::Unit::TestCase
|
|
132
132
|
outputs, outputs )
|
133
133
|
end
|
134
134
|
|
135
|
+
def test_shell_error_late_exit
|
136
|
+
exit_code, outputs = capture3( sh_args( <<-'SH', error: false ) )
|
137
|
+
echo before
|
138
|
+
(exit 33)
|
139
|
+
echo after
|
140
|
+
exit 34
|
141
|
+
SH
|
142
|
+
assert_equal( 34, exit_code )
|
143
|
+
assert_equal( [[:out, ( "before\nafter\n" )]],
|
144
|
+
outputs, outputs )
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_shell_error_early_exit
|
148
|
+
exit_code, outputs = capture3( sh_args( <<-'SH', error: true ) )
|
149
|
+
echo before
|
150
|
+
(exit 33)
|
151
|
+
echo after
|
152
|
+
exit 34
|
153
|
+
SH
|
154
|
+
assert_equal( 33, exit_code )
|
155
|
+
assert_equal( [[:out, ( "before\n" )]],
|
156
|
+
outputs, outputs )
|
157
|
+
end
|
158
|
+
|
159
|
+
def test_shell_pipe_no_fail
|
160
|
+
exit_code, outputs =
|
161
|
+
capture3( sh_args( <<-'SH', error: true, pipefail: false ) )
|
162
|
+
(echo first && exit 33) | (cat - && echo second)
|
163
|
+
exit 34
|
164
|
+
SH
|
165
|
+
assert_equal( 34, exit_code )
|
166
|
+
assert_equal( [[:out, ( "first\nsecond\n" )]],
|
167
|
+
outputs, outputs )
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_shell_pipefail
|
171
|
+
exit_code, outputs =
|
172
|
+
capture3( sh_args( <<-'SH', error: true, pipefail: true ) )
|
173
|
+
(echo first && exit 33) | (cat - && echo second)
|
174
|
+
exit 34
|
175
|
+
SH
|
176
|
+
assert_equal( 33, exit_code )
|
177
|
+
assert_equal( [[:out, ( "first\nsecond\n" )]],
|
178
|
+
outputs, outputs )
|
179
|
+
end
|
180
|
+
|
135
181
|
def test_sudo
|
136
182
|
skip unless SAFE_SUDO
|
137
183
|
cmd = sudo_args( 'echo foo', user: :root )
|
@@ -140,6 +186,18 @@ class TestShell < MiniTest::Unit::TestCase
|
|
140
186
|
assert_equal( [[:out, "foo\n"]], outputs, outputs )
|
141
187
|
end
|
142
188
|
|
189
|
+
def test_sudo_pipefail
|
190
|
+
skip unless SAFE_SUDO
|
191
|
+
exit_code, outputs =
|
192
|
+
capture3( sudo_args( <<-'SH', user: :root, error: true, pipefail: true ) )
|
193
|
+
(echo first && exit 33) | (cat - && echo second)
|
194
|
+
exit 34
|
195
|
+
SH
|
196
|
+
assert_equal( 33, exit_code )
|
197
|
+
assert_equal( [[:out, ( "first\nsecond\n" )]],
|
198
|
+
outputs, outputs )
|
199
|
+
end
|
200
|
+
|
143
201
|
def test_ssh
|
144
202
|
skip unless SAFE_SSH
|
145
203
|
cmd = ssh_args( SAFE_SSH, 'echo foo', sh_verbose: :v )
|
data/test/test_space_main.rb
CHANGED
@@ -34,7 +34,7 @@ class TestSpaceMain < MiniTest::Unit::TestCase
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def test
|
37
|
-
skip if defined?( JRUBY_VERSION ) # 1.6.8
|
37
|
+
skip if defined?( JRUBY_VERSION ) # 1.6.8, 1.7.10-12 fail this test
|
38
38
|
assert( @sp.execute( @sp.hosts, [ [IyyovDaemon, :daemon_service_dir] ] ) )
|
39
39
|
end
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syncwrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Kellum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: '1.46'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: '1.46'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,20 +92,6 @@ dependencies:
|
|
92
92
|
- - "<"
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '1.7'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: uuidtools
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - "~>"
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 2.1.3
|
102
|
-
type: :runtime
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - "~>"
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: 2.1.3
|
109
95
|
- !ruby/object:Gem::Dependency
|
110
96
|
name: minitest
|
111
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -219,17 +205,14 @@ files:
|
|
219
205
|
- sync/etc/init.d/iyyov.erb
|
220
206
|
- sync/etc/init.d/qpidd
|
221
207
|
- sync/etc/sysconfig/pgsql/postgresql.erb
|
222
|
-
- sync/etc/sysctl.d/61-postgresql-shm.conf
|
208
|
+
- sync/etc/sysctl.d/61-postgresql-shm.conf.erb
|
223
209
|
- sync/jruby/bin/jgem
|
224
|
-
- sync/postgresql/
|
225
|
-
- sync/postgresql/
|
226
|
-
- sync/postgresql/
|
227
|
-
- sync/postgresql/
|
228
|
-
- sync/postgresql/
|
229
|
-
- sync/postgresql/
|
230
|
-
- sync/postgresql/ubuntu/pg_ident.conf
|
231
|
-
- sync/postgresql/ubuntu/postgresql.conf
|
232
|
-
- sync/postgresql/ubuntu/start.conf
|
210
|
+
- sync/postgresql/environment
|
211
|
+
- sync/postgresql/pg_ctl.conf
|
212
|
+
- sync/postgresql/pg_hba.conf.erb
|
213
|
+
- sync/postgresql/pg_ident.conf
|
214
|
+
- sync/postgresql/postgresql.conf.erb
|
215
|
+
- sync/postgresql/start.conf
|
233
216
|
- sync/src/hashdot/Makefile.erb
|
234
217
|
- sync/src/hashdot/profiles/default.hdp.erb
|
235
218
|
- sync/src/hashdot/profiles/jruby-common.hdp
|
@@ -1,87 +0,0 @@
|
|
1
|
-
# PostgreSQL Client Authentication Configuration File
|
2
|
-
# ===================================================
|
3
|
-
#
|
4
|
-
# Refer to the "Client Authentication" section in the PostgreSQL
|
5
|
-
# documentation for a complete description of this file. A short
|
6
|
-
# synopsis follows.
|
7
|
-
#
|
8
|
-
# This file controls: which hosts are allowed to connect, how clients
|
9
|
-
# are authenticated, which PostgreSQL user names they can use, which
|
10
|
-
# databases they can access. Records take one of these forms:
|
11
|
-
#
|
12
|
-
# local DATABASE USER METHOD [OPTIONS]
|
13
|
-
# host DATABASE USER ADDRESS METHOD [OPTIONS]
|
14
|
-
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
|
15
|
-
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
|
16
|
-
#
|
17
|
-
# (The uppercase items must be replaced by actual values.)
|
18
|
-
#
|
19
|
-
# The first field is the connection type: "local" is a Unix-domain
|
20
|
-
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
|
21
|
-
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
|
22
|
-
# plain TCP/IP socket.
|
23
|
-
#
|
24
|
-
# DATABASE can be "all", "sameuser", "samerole", "replication", a
|
25
|
-
# database name, or a comma-separated list thereof. The "all"
|
26
|
-
# keyword does not match "replication". Access to replication
|
27
|
-
# must be enabled in a separate record (see example below).
|
28
|
-
#
|
29
|
-
# USER can be "all", a user name, a group name prefixed with "+", or a
|
30
|
-
# comma-separated list thereof. In both the DATABASE and USER fields
|
31
|
-
# you can also write a file name prefixed with "@" to include names
|
32
|
-
# from a separate file.
|
33
|
-
#
|
34
|
-
# ADDRESS specifies the set of hosts the record matches. It can be a
|
35
|
-
# host name, or it is made up of an IP address and a CIDR mask that is
|
36
|
-
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
|
37
|
-
# specifies the number of significant bits in the mask. A host name
|
38
|
-
# that starts with a dot (.) matches a suffix of the actual host name.
|
39
|
-
# Alternatively, you can write an IP address and netmask in separate
|
40
|
-
# columns to specify the set of hosts. Instead of a CIDR-address, you
|
41
|
-
# can write "samehost" to match any of the server's own IP addresses,
|
42
|
-
# or "samenet" to match any address in any subnet that the server is
|
43
|
-
# directly connected to.
|
44
|
-
#
|
45
|
-
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
|
46
|
-
# "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
|
47
|
-
# "password" sends passwords in clear text; "md5" is preferred since
|
48
|
-
# it sends encrypted passwords.
|
49
|
-
#
|
50
|
-
# OPTIONS are a set of options for the authentication in the format
|
51
|
-
# NAME=VALUE. The available options depend on the different
|
52
|
-
# authentication methods -- refer to the "Client Authentication"
|
53
|
-
# section in the documentation for a list of which options are
|
54
|
-
# available for which authentication methods.
|
55
|
-
#
|
56
|
-
# Database and user names containing spaces, commas, quotes and other
|
57
|
-
# special characters must be quoted. Quoting one of the keywords
|
58
|
-
# "all", "sameuser", "samerole" or "replication" makes the name lose
|
59
|
-
# its special character, and just match a database or username with
|
60
|
-
# that name.
|
61
|
-
#
|
62
|
-
# This file is read on server startup and when the postmaster receives
|
63
|
-
# a SIGHUP signal. If you edit the file on a running system, you have
|
64
|
-
# to SIGHUP the postmaster for the changes to take effect. You can
|
65
|
-
# use "pg_ctl reload" to do that.
|
66
|
-
|
67
|
-
# Put your actual configuration here
|
68
|
-
# ----------------------------------
|
69
|
-
#
|
70
|
-
# If you want to allow non-local connections, you need to add more
|
71
|
-
# "host" records. In that case you will also need to make PostgreSQL
|
72
|
-
# listen on a non-local interface via the listen_addresses
|
73
|
-
# configuration parameter, or via the -i or -h command line switches.
|
74
|
-
|
75
|
-
# TYPE DATABASE USER ADDRESS METHOD
|
76
|
-
|
77
|
-
# "local" is for Unix domain socket connections only
|
78
|
-
local all all peer
|
79
|
-
# IPv4 local connections:
|
80
|
-
host all all 127.0.0.1/32 trust
|
81
|
-
# IPv6 local connections:
|
82
|
-
host all all ::1/128 trust
|
83
|
-
# Allow replication connections from localhost, by a user with the
|
84
|
-
# replication privilege.
|
85
|
-
#local replication postgres peer
|
86
|
-
#host replication postgres 127.0.0.1/32 ident
|
87
|
-
#host replication postgres ::1/128 ident
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# PostgreSQL User Name Maps
|
2
|
-
# =========================
|
3
|
-
#
|
4
|
-
# Refer to the PostgreSQL documentation, chapter "Client
|
5
|
-
# Authentication" for a complete description. A short synopsis
|
6
|
-
# follows.
|
7
|
-
#
|
8
|
-
# This file controls PostgreSQL user name mapping. It maps external
|
9
|
-
# user names to their corresponding PostgreSQL user names. Records
|
10
|
-
# are of the form:
|
11
|
-
#
|
12
|
-
# MAPNAME SYSTEM-USERNAME PG-USERNAME
|
13
|
-
#
|
14
|
-
# (The uppercase quantities must be replaced by actual values.)
|
15
|
-
#
|
16
|
-
# MAPNAME is the (otherwise freely chosen) map name that was used in
|
17
|
-
# pg_hba.conf. SYSTEM-USERNAME is the detected user name of the
|
18
|
-
# client. PG-USERNAME is the requested PostgreSQL user name. The
|
19
|
-
# existence of a record specifies that SYSTEM-USERNAME may connect as
|
20
|
-
# PG-USERNAME.
|
21
|
-
#
|
22
|
-
# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a
|
23
|
-
# regular expression. Optionally this can contain a capture (a
|
24
|
-
# parenthesized subexpression). The substring matching the capture
|
25
|
-
# will be substituted for \1 (backslash-one) if present in
|
26
|
-
# PG-USERNAME.
|
27
|
-
#
|
28
|
-
# Multiple maps may be specified in this file and used by pg_hba.conf.
|
29
|
-
#
|
30
|
-
# No map names are defined in the default configuration. If all
|
31
|
-
# system user names and PostgreSQL user names are the same, you don't
|
32
|
-
# need anything in this file.
|
33
|
-
#
|
34
|
-
# This file is read on server startup and when the postmaster receives
|
35
|
-
# a SIGHUP signal. If you edit the file on a running system, you have
|
36
|
-
# to SIGHUP the postmaster for the changes to take effect. You can
|
37
|
-
# use "pg_ctl reload" to do that.
|
38
|
-
|
39
|
-
# Put your actual configuration here
|
40
|
-
# ----------------------------------
|
41
|
-
|
42
|
-
# MAPNAME SYSTEM-USERNAME PG-USERNAME
|