Class: Subspace::Commands::Ssh
- Defined in:
- lib/subspace/commands/ssh.rb
Instance Method Summary collapse
-
#initialize(args, options) ⇒ Ssh
constructor
A new instance of Ssh.
- #run ⇒ Object
Methods inherited from Base
#copy, #dest_dir, #gem_path, #require_configuration, #template, #template_dir
Methods included from Ansible
Constructor Details
#initialize(args, options) ⇒ Ssh
Returns a new instance of Ssh.
3 4 5 6 |
# File 'lib/subspace/commands/ssh.rb', line 3 def initialize(args, ) @host = args.first run end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 |
# File 'lib/subspace/commands/ssh.rb', line 8 def run host_vars = YAML.load_file("config/provision/host_vars/#{@host}") cmd = "ssh #{host_vars["ansible_ssh_user"]}@#{host_vars["ansible_ssh_host"]}" say cmd exec cmd end |