Skip to content

Commit

Permalink
Use ssh_forwardagent as a key in a Host dict
Browse files Browse the repository at this point in the history
  • Loading branch information
wvandeun committed Jun 27, 2018
1 parent c0ea53a commit d870431
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nornir/plugins/tasks/commands/remote_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def remote_command(task, command):

chan = client.get_transport().open_session()

if task.host.ssh_forwardagent:
if task.host["ssh_forwardagent"]:
AgentRequestHandler(chan)

chan.exec_command(command)
Expand Down
3 changes: 2 additions & 1 deletion nornir/plugins/tasks/connections/paramiko_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ def paramiko_connection(task=None):
if "proxycommand" in user_config:
parameters["sock"] = paramiko.ProxyCommand(user_config["proxycommand"])

task.host["ssh_forwardagent"] = False
if "forwardagent" in user_config:
if user_config["forwardagent"] == "yes":
task.host.ssh_forwardagent = True
task.host["ssh_forwardagent"] = True

# TODO configurable
# if ssh_key_file:
Expand Down

0 comments on commit d870431

Please sign in to comment.