pec2 0.6.0 → 0.6.1

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: 550ba6ff5b0de826f866deeafc7d97eb159980b9
4
- data.tar.gz: 6fcf46712f036133de9c7c489c8cc30fbb80dc72
3
+ metadata.gz: 5d212e880ee55a9fd7282d28c16d77b9435019b3
4
+ data.tar.gz: 582aa6fd904cc9a75ec0d6a2063706ceada859d7
5
5
  SHA512:
6
- metadata.gz: 6935e5dda4e21de298670ee7c20eff00d7e031db0d92aaaee9bc2d0cb189c7f8c8baefe7592bf9d99de52fe1466e930f4a78aed03949ae822905e8379b2c6816
7
- data.tar.gz: 93dd2d07b2852a0729c51f5c7862a337615ac53b40b5a59f8d3509dc55d7efc2cc4f563894132a527c4304f3a17fb2dc167a5233e3f37d7e4f33679a7ed22337
6
+ metadata.gz: ba417870100d95967e9df7dcbcd501bb7e15e81905554295d1a2acaa1ff732a45424c69903cb1f19510009dd66ff56812943db26526e99821664829639ba7053
7
+ data.tar.gz: 7cc2a92acc8c92ab9b96235e32765bb86e8e89928b2abef6ae554d549425c36db6e4ef33101d707698e597da0feeb3e575ddf63e99c1a90a64ddf44df0de6ad9
@@ -17,6 +17,7 @@ module Pec2
17
17
 
18
18
  desc 'run_command', 'run command'
19
19
  option :command, aliases: '-c', type: :string, desc: 'command'
20
+ option :file, aliases: '-f', type: :string, desc: 'script file'
20
21
  option :sudo_password, aliases: '-s', type: :string, desc: 'sudo_password'
21
22
  option :tag, aliases: '-t', type: :hash, default: {}, desc: 'tag'
22
23
  option :user, aliases: '-u', type: :string, desc: 'user'
@@ -44,7 +45,9 @@ module Pec2
44
45
 
45
46
  pssh = Pssh.new(options, addresses, addresses.size)
46
47
 
47
- interactive = options[:command] ? false : true
48
+ file_command = options[:file] ? File.read(options[:file]) : nil
49
+ command = options[:command] || file_command
50
+ interactive = command ? false : true
48
51
 
49
52
  if interactive
50
53
  while true
@@ -52,7 +55,7 @@ module Pec2
52
55
  pssh.exec_pssh_command(command)
53
56
  end
54
57
  else
55
- ret = pssh.exec_pssh_command(options[:command])
58
+ ret = pssh.exec_pssh_command(command)
56
59
  unless ret
57
60
  exit 1
58
61
  end
@@ -1,4 +1,4 @@
1
1
  module Pec2
2
2
  # pec2 version
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919