# fortigate / fortinet

**URL:** <https://forum.ansible.com/t/fortigate-fortinet/32866>\
**Category:** Ansible Project\
**Created:** [May 6, 2020, 7:49pm UTC](https://forum.ansible.com/t/fortigate-fortinet/32866 "2020-05-06T19:49:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Meyer1](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Post date:** [May 6, 2020, 7:49pm UTC](https://forum.ansible.com/t/fortigate-fortinet/32866/1 "2020-05-06T19:49:50Z")

</div>

Has anyone gotten a fortinet/fortigate playbook to work? I have a Fortigate 100D running 6.2.2 and I can’t get it to pass an ansible ping.

---

<div class="post-metadata">

**Author:** ![Andrew\_Meyer1](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Post date:** [May 7, 2020, 1:03pm UTC](https://forum.ansible.com/t/fortigate-fortinet/32866/2 "2020-05-07T13:03:47Z")

</div>

Here is what I am getting:

`ansible -m ping 10.150.1.1 --user=ansible`  
`[WARNING]: sftp transfer mechanism failed on [10.150.1.1]. Use ANSIBLE_DEBUG=1 to see detailed information`  
`[WARNING]: scp transfer mechanism failed on [10.150.1.1]. Use ANSIBLE_DEBUG=1 to see detailed information`  
`10.150.1.1 | FAILED! => {`  
`"changed": false,`  
`"module_stderr": "Shared connection to 10.150.1.1 closed.\r\n",`  
`"module_stdout": "fw01 # Unknown action 0\r\n\r\nfw01 # ",`  
`"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",`  
`"rc": 0`  
`}`

`ansible -m ping fw01.loc.example.com --user=ansible`  
`[WARNING]: sftp transfer mechanism failed on [fw01.loc.example.com]. Use ANSIBLE_DEBUG=1 to see detailed information`  
`[WARNING]: scp transfer mechanism failed on [fw01.loc.example.com]. Use ANSIBLE_DEBUG=1 to see detailed information`  
`fw01.loc.example.com | FAILED! => {`  
`"changed": false,`  
`"module_stderr": "Shared connection to fw01.loc.example.com closed.\r\n",`  
`"module_stdout": "fw01 # Unknown action 0\r\n\r\nfw01 # ",`  
`"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",`  
`"rc": 0`  
`}`

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [May 11, 2020, 9:08pm UTC](https://forum.ansible.com/t/fortigate-fortinet/32866/3 "2020-05-11T21:08:11Z")

</div>

I don't know what a Fortigate is, but I guess some kind of network equipment.

Ansible ping is not a ICMP ping, it's a module that copies a Python script to  
the remote host and run the Python script on that host.

Most network equipment doesn't have a proper shell(which "default" Ansible need) and Python installed.

So to use Ansible you need to use the raw and/or expect module so interact with the device.  
You also have Ansible for Network that might work  
[https://docs.ansible.com/ansible/latest/network/index.html](https://docs.ansible.com/ansible/latest/network/index.html)

---

<div class="post-metadata">

**Author:** ![Robert\_Gratz](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Robert\_Gratz](https://forum.ansible.com/u/Robert_Gratz)\
**Post date:** [May 13, 2020, 9:20am UTC](https://forum.ansible.com/t/fortigate-fortinet/32866/4 "2020-05-13T09:20:57Z")

</div>

Hallo Andrew,

I had the same problem as you. Please use [https://galaxy.ansible.com/fortinet/fortios](https://galaxy.ansible.com/fortinet/fortios). This works very well.

---

<div class="post-metadata">

**Author:** ![Venu\_Devannagari](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@Venu\_Devannagari](https://forum.ansible.com/u/Venu_Devannagari)\
**Post date:** [August 12, 2020, 9:22am UTC](https://forum.ansible.com/t/fortigate-fortinet/32866/5 "2020-08-12T09:22:50Z")

</div>

Hi Robert,

Are you able to run playbooks using fortinet galaxy collections.

Actually I am facing issue using it.

Can you please show how you maintain inventory file and playbook with sample values.

Is it work with python2 interpreter.

I am getting timeout error.

---

<div class="post-metadata">

**Author:** ![Venu\_Devannagari](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@Venu\_Devannagari](https://forum.ansible.com/u/Venu_Devannagari)\
**Post date:** [August 12, 2020, 9:26am UTC](https://forum.ansible.com/t/fortigate-fortinet/32866/6 "2020-08-12T09:26:14Z")

</div>

my ansible is on python2.7 I have tried by change ansible\_python\_interpreter=/usr/bin/python3 but nothing works out can you please help here.
