hammer_cli_foreman_ssh 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8964927a1adbb4a518e8abba7aaa185bd00eb55e
4
- data.tar.gz: 9a512d7632e37ffdc667ca5e5ea5926254cac8cb
3
+ metadata.gz: 72122353341170b4412a4bee8a3fab00ff79849d
4
+ data.tar.gz: 11fa69f7d181d7c7dbc204674ef923d2cea10851
5
5
  SHA512:
6
- metadata.gz: a8502378c81fb1b5a9b12f2330b798ab3c5384f8ab342f981ee6e113f7eda259d757be6b81940f823a77b9050f718212d059142f2a51a9f1aaf2ce75367ea9f9
7
- data.tar.gz: bb652c97e534091271d5ffd95d70c84504df2d395f699bd87aa933d548c4a37d6b901cd8bd0ef6a9e2b148cfa3ff127553469aa8137da18582ada0d312182481
6
+ metadata.gz: 91b8c148411fed0459ad9bc39e7d2e76d777e478cc094726d608037b52e5f2f7a94ad483cc82268ecffb1f5fa6c16bbbc4c32b6c41b7b7aa1c68e9764ed1ff8b
7
+ data.tar.gz: 0ae905ea2f90685fe014d18b86c35c8753885d8c31ecf514d65f6bb03e3a3287aa402077c6a47307c883060de4ed4ab7b58600a1f99e98c323a1e6ba9a3d34c1
data/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ This program and entire repository is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
2
+
3
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
4
+
5
+ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ Hammer CLI - Foreman SSH
2
+ ========================
3
+
4
+ the plugin for hammer
5
+
6
+ Install
7
+ -------
8
+
9
+ ```bash
10
+ $ git clone git@github.com:theforeman/hammer-cli-foreman-ssh.git
11
+ $ cd hammer-cli-foreman-ssh
12
+ $ rake install
13
+ $ cd ..
14
+ ```
15
+
16
+ register the plugin in the hammer configuration directory
17
+
18
+ ```
19
+ cat > ~/.hammer/cli.modules.d/foreman_ssh.yml <<EOF
20
+ :foreman_ssh:
21
+ :enable_module: true
22
+ :require: 'foreman'
23
+ EOF
24
+ ```
25
+
26
+ and enjoy
27
+
28
+ ```
29
+ $ hammer host ssh --command 'yum upgrade -q -y bash' --user root --search='facts.bashpocalypse = not_vulnerable' --no-prompt
30
+ About to execute: yum upgrade -y bash as user root
31
+ on the following 3 hosts: host1, host2, host3
32
+ [host1] No Packages marked for Update
33
+ [host2] No Packages marked for Update
34
+ [host3] No Packages marked for Update
35
+ ```
36
+
37
+ Usage Options
38
+ -------------
39
+
40
+
41
+ ```
42
+ $ hammer host ssh --help
43
+ Usage:
44
+ hammer host ssh [OPTIONS]
45
+
46
+ Options:
47
+ --[no-]dns Use DNS to resolve IP addresses
48
+ --[no-]prompt Prompt for users approval
49
+ -c, --command COMMAND Command to execute
50
+ -h, --help print help
51
+ -s, --search FILTER Filter hosts based on a filter
52
+ -u, --user USER Execute as user
53
+ Default: "ohad"
54
+ ```
55
+
56
+ License
57
+ -------
58
+ This project is licensed under the GPLv3+.
@@ -1,7 +1,7 @@
1
1
  module HammerCLIForeman
2
2
  module SSH
3
3
  def self.version
4
- @version ||= Gem::Version.new '0.0.1'
4
+ @version ||= Gem::Version.new '0.0.2'
5
5
  end
6
6
  end
7
7
  end
@@ -16,6 +16,9 @@ module HammerCLIForeman::SSH
16
16
  option %w(-s --search), 'FILTER', _('Filter hosts based on a filter'), :attribute_name => :search
17
17
  option '--[no-]dns', :flag, _('Use DNS to resolve IP addresses'), :attribute_name => :use_dns
18
18
  option '--[no-]prompt', :flag, _('Prompt for users approval'), :attribute_name => :prompt
19
+ option %w(-i --identity_file), 'FILE',
20
+ _('Selects a file from which the identity (private key) for public key authentication is read'),
21
+ :attribute_name => :identity_file
19
22
 
20
23
  def request_params
21
24
  params = super
@@ -34,6 +37,7 @@ module HammerCLIForeman::SSH
34
37
  end
35
38
 
36
39
  ssh_options = { :user => user, :auth_methods => ['publickey'] }
40
+ ssh_options[:keys] = [identity_file] unless identity_file.to_s.empty?
37
41
 
38
42
  Net::SSH::Multi.start(:on_error => :warn) do |session|
39
43
  targets.each { |s| session.use s, ssh_options }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ohad Levy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hammer_cli
@@ -58,11 +58,14 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - LICENSE
62
+ - README.md
61
63
  - lib/hammer_cli_foreman/ssh.rb
62
64
  - lib/hammer_cli_foreman/ssh/version.rb
63
65
  - lib/hammer_cli_foreman_ssh.rb
64
66
  homepage:
65
- licenses: []
67
+ licenses:
68
+ - GPLv3+
66
69
  metadata: {}
67
70
  post_install_message:
68
71
  rdoc_options: []