# Not able to ssh on fortigate from ansible

**URL:** <https://forum.ansible.com/t/not-able-to-ssh-on-fortigate-from-ansible/32187>\
**Category:** Ansible Project\
**Created:** [February 10, 2020, 10:40am UTC](https://forum.ansible.com/t/not-able-to-ssh-on-fortigate-from-ansible/32187 "2020-02-10T10:40:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharat\_Bhushan\_Mehta](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@Bharat\_Bhushan\_Mehta](https://forum.ansible.com/u/Bharat_Bhushan_Mehta)\
**Post date:** [February 10, 2020, 10:40am UTC](https://forum.ansible.com/t/not-able-to-ssh-on-fortigate-from-ansible/32187/1 "2020-02-10T10:40:03Z")

</div>

Hi Team,

I am trying to take config backup of fortigate vm which is having version v6.2.3 using ansible, while doing this i am getting below error:-  
The full traceback is:  
WARNING: The below traceback may _not_ be related to the actual failure.  
File “/tmp/ansible\_fortios\_config\_payload\_BI\_dEM/ansible\_fortios\_config\_payload.zip/ansible/modules/network/fortios/fortios\_config.py”, line 126, in main  
File “/usr/lib/python2.7/site-packages/pyFG/fortios.py”, line 103, in open  
self.ssh.connect(\*\*cfg)  
File “/usr/lib/python2.7/site-packages/paramiko/client.py”, line 380, in connect  
look\_for\_keys, gss\_auth, gss\_kex, gss\_deleg\_creds, gss\_host)  
File “/usr/lib/python2.7/site-packages/paramiko/client.py”, line 554, in \_auth  
self.\_agent = Agent()  
File “/usr/lib/python2.7/site-packages/paramiko/agent.py”, line 363, in **init**  
self.\_connect(conn)  
File “/usr/lib/python2.7/site-packages/paramiko/agent.py”, line 68, in \_connect  
raise SSHException(‘could not get keys from ssh-agent’)

fatal: [localhost]: FAILED! =\> {  
“changed”: false,  
“invocation”: {  
“module\_args”: {  
“backup”: true,  
“backup\_filename”: null,  
“backup\_path”: “/tmp”,  
“config\_file”: null,  
“file\_mode”: false,  
“filter”: “”,  
“host”: “10.35.110.133”,  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“src”: null,  
“timeout”: 60,  
“username”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“vdom”: “root”  
}  
},  
“msg”: “Error connecting device”

Here is my play book

- hosts: “localhost”  
connection: local  
gather\_facts: False  
vars:  
host: “10.35.110.133”  
vdom: “root”  
ssl\_verify: “False”  
tasks:
- name: Backup current config  
fortios\_config:  
host: “10.35.110.133”  
username: admin  
password: admin  
backup: yes  
backup\_path: /tmp

Please suggest what i can do over here
