chake 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 825031afb9cace35e4f750ed736f80532e99d55b
4
- data.tar.gz: 118d6e7f4a98d8215ba3bde42f4037405d1dd159
3
+ metadata.gz: 1eb55dbcfe2c5a55b4f25f91577343bdcb012e2b
4
+ data.tar.gz: 5a5bba8b619a44b1b020dd1b08dbadf4a13b6f60
5
5
  SHA512:
6
- metadata.gz: f12ed797e7fe14c6f9db8f47483b55fc9bd671b8735b7f078cc8268f539782bfe7310fbba27958b19cf8b9b471eb4cfaa410711dc57b27e9e47599ad8b2d6dc6
7
- data.tar.gz: 018fcbac5e10fad14bec70a18d8d69b23cbbf4ddf30c2b8d9b7b1c5c193b17d81c9e44439d27802a990a08aa625c56e5ca5e2909039356e6e245914a0dde9b9a
6
+ metadata.gz: adbbf6f0e28b6786f237d3fe98b6328dc392f29270c3cdc8237bb79b5ed650fdfc096fae134f252d03a25af9b8ee2a3bb50a44c2d0bdd4b2d390cbd9313f6369
7
+ data.tar.gz: 28aa419d152a89658fccc7abe108cf68743c3e79babe5a8f249836f62fcc35949f18a79a459cd23f5086002ccca4ba2262cdf98a120182abd64e76bba18ab164
@@ -1,3 +1,9 @@
1
+ # 0.6
2
+
3
+ * Support a ssh prefix command by setting `$CHAKE_SSH_PREFIX` in the
4
+ environment. For example, `CHAKE_SSH_PREFIX=tsocks` will make all ssh
5
+ invocations as `tocks ssh ...` instead of just `ssh ...`.
6
+
1
7
  # 0.5
2
8
 
3
9
  * Add a task login:$host that you can use to easily log in to any of your
data/README.md CHANGED
@@ -160,6 +160,19 @@ To easily login to one of your host, just run `rake login:$HOSTNAME`. This will
160
160
  automatically use the repository-local SSH configuration as above so you don't
161
161
  have to type `-F .ssh_config` all the time.
162
162
 
163
+ ### Running all SSH invocations with some prefix command
164
+
165
+ Some times, you will also want or need to prefix your SSH invocations with some
166
+ prefix command in order to e.g. tunnel it through some central exit node. You
167
+ can do this by setting `$CHAKE_SSH_PREFIX` on your environment. Example:
168
+
169
+ ```
170
+ CHAKE_SSH_PREFIX=tsocks rake converge
171
+ ```
172
+
173
+ The above will make all SSH invocations to all hosts be called as `tsocks ssh
174
+ [...]`
175
+
163
176
  ### Converging local host
164
177
 
165
178
  If you want to manage your local workstation with chake, you can declare a local node like this in `nodes.yaml`:
@@ -194,6 +207,7 @@ vice-versa.
194
207
  |Variable|Meaning|Default value|
195
208
  |--------|-------|-------------|
196
209
  | `$CHAKE_SSH_CONFIG` | local SSH configuration file | `.ssh_config` |
210
+ | `$CHAKE_SSH_PREFIX` | Command to prefix SSH (and rsync over SSH) calls with | _none_ |
197
211
  | `$CHAKE_RSYNC_OPTIONS` | extra options to pass to `rsync`. Useful to e.g. exclude large files from being upload to each server | _none_ |
198
212
  | `$CHAKE_NODES` | File containing the list of servers to be managed | _nodes.yaml` |
199
213
 
@@ -13,7 +13,7 @@ module Chake
13
13
  end
14
14
 
15
15
  def rsync
16
- ['rsync', rsync_ssh].flatten.compact
16
+ [ssh_prefix, 'rsync', rsync_ssh].flatten.compact
17
17
  end
18
18
 
19
19
  def rsync_dest
@@ -21,7 +21,7 @@ module Chake
21
21
  end
22
22
 
23
23
  def command_runner
24
- ['ssh', ssh_config, ssh_target].flatten.compact
24
+ [ssh_prefix, 'ssh', ssh_config, ssh_target].flatten.compact
25
25
  end
26
26
 
27
27
  def shell_command
@@ -42,6 +42,10 @@ module Chake
42
42
  @ssh_config_file ||= ENV.fetch('CHAKE_SSH_CONFIG', '.ssh_config')
43
43
  end
44
44
 
45
+ def ssh_prefix
46
+ @ssh_prefix ||= ENV.fetch('CHAKE_SSH_PREFIX', '').split
47
+ end
48
+
45
49
  def ssh_target
46
50
  [node.remote_username, node.hostname].compact.join('@')
47
51
  end
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = "0.5"
2
+ VERSION = "0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chake
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Terceiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler