I might be mistaken, but when dealing with network devices there should be 
something like:

connection: local

somewhere at the beginning of the playbook.

And the content of the playbook itself would be helpful here I think.

Please also check:
https://www.ansible.com/webinars-training/ansible-playbooks-using-network-modules


Od: [email protected] [mailto:[email protected]] 
W imieniu Asif Iqbal
Wysłano: 25 kwietnia 2017 21:31
Do: Ansible Project <[email protected]>
Temat: [ansible-project] junos_command

I am failing to make junos_command work

2017-04-25 15:28:49,152 p=4058 u=user |  PLAY [sdwan-routers] 
****************************************************************************************************
2017-04-25 15:28:49,171 p=4058 u=user |  TASK [junos_command] 
****************************************************************************************************
2017-04-25 15:28:49,572 p=4084 u=user |  creating new control socket for host 
router.example.net:830 as user None
2017-04-25 15:28:49,572 p=4084 u=user |  control socket path is 
/home/user/.ansible/pc/c08d46d021
2017-04-25 15:28:49,572 p=4084 u=user |  current working directory is 
/home/user/ansible/sdwan
2017-04-25 15:28:49,572 p=4084 u=user |  using connection plugin netconf
2017-04-25 15:28:49,629 p=4084 u=user |  network_os is set to junos
2017-04-25 15:28:49,629 p=4084 u=user |  ssh connection done, stating ncclient
2017-04-25 15:28:59,694 p=4084 u=user |  failed to create control socket for 
host router.example.net
2017-04-25 15:28:59,695 p=4084 u=user |  Traceback (most recent call last):
  File "/usr/bin/ansible-connection", line 298, in main
    server = Server(sf_path, pc)
  File "/usr/bin/ansible-connection", line 135, in __init__
    self.conn._connect()
  File 
"/usr/lib/python2.7/dist-packages/ansible/plugins/connection/netconf.py", line 
95, in _connect
    device_params={'name': self._network_os}
  File "/usr/lib/python2.7/dist-packages/ncclient/manager.py", line 149, in 
connect
    return connect_ssh(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/ncclient/manager.py", line 118, in 
connect_ssh
    session.connect(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/ncclient/transport/ssh.py", line 372, 
in connect
    raise SSHError("Could not open socket to %s:%s" % (host, port))
SSHError: Could not open socket to router.example.net:830

2017-04-25 15:29:19,598 p=4084 u=user |  number of connection attempts 
exceeded, unable to connect to control socket
2017-04-25 15:29:19,599 p=4084 u=user |  persistent_connect_interval=1, 
persistent_connect_retries=30
2017-04-25 15:29:19,625 p=4058 u=user |  fatal: [router.example.net]: FAILED! 
=> {"changed": false, "failed": true, "msg": "unable to open shell. Please see: 
https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell";,
 "rc": 255}
2017-04-25 15:29:19,626 p=4058 u=user |  PLAY RECAP 
**************************************************************************************************************
2017-04-25 15:29:19,626 p=4058 u=user |  router.example.net : ok=0    changed=0 
   unreachable=0    failed=1

I can only ssh to the router through a proxy host and the router does not have 
any port 830 open and I verified.

Please advise a workaround..

Thanks

--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c11d6f3a-c468-4c41-a097-bdd511cf0cf5%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/c11d6f3a-c468-4c41-a097-bdd511cf0cf5%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

ING Services Polska Sp. z o. o. ul. Konduktorska 35, 40-155 Katowice, NIP 
634-251-05-98, KRS 0000183258 Sąd Rejonowy w Katowicach, Wydział VIII 
Gospodarczy Krajowego Rejestru Sądowego, Kapitał zakładowy - 13 950 000,00 zł 
wpłacony w całości.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/21a0896f486f4a89a24962b052717552%40SU8000006107.ad.ing.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to