Class: Capistrano_karaf::Backend::KarafCommand
- Inherits:
-
Object
- Object
- Capistrano_karaf::Backend::KarafCommand
- Defined in:
- lib/capistrano-karaf/backends/opensshproxy.rb
Instance Attribute Summary collapse
-
#karaf_password ⇒ Object
readonly
Returns the value of attribute karaf_password.
-
#karaf_port ⇒ Object
readonly
Returns the value of attribute karaf_port.
-
#karaf_username ⇒ Object
readonly
Returns the value of attribute karaf_username.
Instance Method Summary collapse
- #create(*args) ⇒ Object
-
#initialize ⇒ KarafCommand
constructor
A new instance of KarafCommand.
Constructor Details
#initialize ⇒ KarafCommand
8 9 10 11 12 |
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 8 def initialize @karaf_username = fetch :karaf_username, "smx" @karaf_password = fetch :karaf_password, "smx" @karaf_port = fetch :karaf_port, "8101" end |
Instance Attribute Details
#karaf_password ⇒ Object (readonly)
Returns the value of attribute karaf_password.
6 7 8 |
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 6 def karaf_password @karaf_password end |
#karaf_port ⇒ Object (readonly)
Returns the value of attribute karaf_port.
6 7 8 |
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 6 def karaf_port @karaf_port end |
#karaf_username ⇒ Object (readonly)
Returns the value of attribute karaf_username.
6 7 8 |
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 6 def karaf_username @karaf_username end |
Instance Method Details
#create(*args) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/capistrano-karaf/backends/opensshproxy.rb', line 14 def create(*args) command = args.shift.to_s.strip command1 = SSHKit.config.command_map[command.to_sym].split(' ') args1 = command1.concat(args) ["sshpass", "-p", karaf_password, "ssh", "-o", "NoHostAuthenticationForLocalhost=yes", "-o", "StrictHostKeyChecking=no", "#{karaf_username}@localhost", "-p", karaf_port].concat(args1) end |