I am trying to use ansible to start making changes to my Fortigate 100D. I can ssh just fine using my ssh keys. However I am getting the following error:
myhost :( > ansible myfwfgt01.loc.example.net -m ping --user=ansible
[WARNING]: sftp transfer mechanism failed on [myfwfgt01.loc.example.net]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [myfwfgt01.loc.example.net]. Use ANSIBLE_DEBUG=1 to see detailed information
myfwfgt01.loc.example.net | FAILED! => {
"changed": false,
"module_stderr": "Shared connection to myfwfgt01.loc.example.net closed.\r\n",
"module_stdout": "myfwfgt01 # Unknown action 0\r\n\r\nmyfwfgt01 # ",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 0
}
myhost :( > ansible myfwfgt01.loc.example.net -m ping
myfwfgt01.loc.example.net | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ameyer@myfwfgt01.loc.example.net: Permission denied (publickey,password).",
"unreachable": true
}
I know its 4 years after you posted this, but did you ever get this resolved?
Created on 02-02-2024 04:59 AM Edited on 02-02-2024 05:00 AM
I was able to get it working by adding this to my playbook:
ansible_network_os: fortinet.fortios.fortios
Below is the working playbook. I found the answer from a reddit post reply by aman207, I tested and replied (as a different username in that post): https://www.reddit.com/r/ansible/comments/ysdj5t/comment/kojhxnz/?utm_source=reddit&utm_medium=web2x...
Testing my web client, will delete after posting.
I got it working, see my reply to my reply above ;)
can you please elaborate the problem you are facing,
User | Count |
---|---|
2117 | |
1187 | |
770 | |
451 | |
344 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.