# file not found

**URL:** <https://forum.ansible.com/t/file-not-found/32422>\
**Category:** Ansible Project\
**Created:** [March 9, 2020, 3:36pm UTC](https://forum.ansible.com/t/file-not-found/32422 "2020-03-09T15:36:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddie\_eakemu1](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@eddie\_eakemu1](https://forum.ansible.com/u/eddie_eakemu1)\
**Post date:** [March 9, 2020, 3:36pm UTC](https://forum.ansible.com/t/file-not-found/32422/1 "2020-03-09T15:36:44Z")

</div>

I am trying to run a playbook and the details come from a file but it is giving me an error message

ansible-playbook -i inventory junos\_config.yml

PLAY [Juniper SRX configuration compliance checks] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Syslog server check] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [172.16.203.121]: FAILED! =\> {“msg”: “FileNotFoundError(2, ‘No such file or directory’)”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
172.16.203.121 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

This is the yaml file

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [March 9, 2020, 4:16pm UTC](https://forum.ansible.com/t/file-not-found/32422/2 "2020-03-09T16:16:07Z")

</div>

> I am trying to run a playbook and the details come from a file but it is giving me an error message
> 
> ansible-playbook -i inventory junos\_config.yml
> 
> PLAY [Juniper SRX configuration compliance checks] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> TASK [Syslog server check] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> fatal: [172.16.203.121]: FAILED! =\> {"msg": "FileNotFoundError(2, 'No such file or directory')"}
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> 172.16.203.121 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

I have no clue about Juniper and the junos\_config module, but it might be worth to run with -vvvv to see where  
Ansible looks for the file.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![eddie\_eakemu1](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@eddie\_eakemu1](https://forum.ansible.com/u/eddie_eakemu1)\
**Post date:** [April 12, 2020, 9:34am UTC](https://forum.ansible.com/t/file-not-found/32422/3 "2020-04-12T09:34:26Z")

</div>

I have run the playbook command with the -vvvv flag and it is giving me this error

[root@gefela ansible\_junos]# ansible-playbook -i inventory junos\_config.yml --check -vvvv  
ansible-playbook 2.9.5  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3.6/site-packages/ansible  
executable location = /usr/bin/ansible-playbook  
python version = 3.6.8 (default, Oct 11 2019, 15:04:54) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)]  
Using /etc/ansible/ansible.cfg as config file  
setting up inventory plugins  
host\_list declined parsing /home/gefela/ansible\_junos/inventory as it did not pass its verify\_file() method  
script declined parsing /home/gefela/ansible\_junos/inventory as it did not pass its verify\_file() method  
auto declined parsing /home/gefela/ansible\_junos/inventory as it did not pass its verify\_file() method  
Parsed /home/gefela/ansible\_junos/inventory inventory source with ini plugin  
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python3.6/site-packages/ansible/plugins/callback/default.py

PLAYBOOK: junos\_config.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Positional arguments: junos\_config.yml  
verbosity: 4  
connection: smart  
timeout: 10  
become\_method: sudo  
tags: (‘all’,)  
check: True  
inventory: (‘/home/gefela/ansible\_junos/inventory’,)  
forks: 5  
1 plays in junos\_config.yml

PLAY [Juniper SRX configuration compliance checks] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
META: ran handlers

TASK [Syslog server check] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/gefela/ansible\_junos/junos\_config.yml:9  
\<172.16.203.121\> attempting to start connection  
\<172.16.203.121\> using connection plugin netconf  
\<172.16.203.121\> local domain socket does not exist, starting it  
\<172.16.203.121\> control socket path is /root/.ansible/pc/3e04c18d96  
\<172.16.203.121\> local domain socket listeners started successfully  
\<172.16.203.121\> loaded netconf plugin junos from path /usr/lib/python3.6/site-packages/ansible/plugins/netconf/junos.py for network\_os junos  
\<172.16.203.121\>  
\<172.16.203.121\> local domain socket path is /root/.ansible/pc/3e04c18d96  
\<172.16.203.121\> ESTABLISH LOCAL CONNECTION FOR USER: gefela  
\<172.16.203.121\> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /root/.ansible/tmp/ansible-local-10845_kx_3k77/ansible-tmp-1586683874.2918632-239315467988226`” && echo ansible-tmp-1586683874.2918632-239315467988226=“`echo /root/.ansible/tmp/ansible-local-10845_kx_3k77/ansible-tmp-1586683874.2918632-239315467988226`” ) && sleep 0’  
\<172.16.203.121\> Attempting python interpreter discovery  
\<172.16.203.121\> EXEC /bin/sh -c ‘echo PLATFORM; uname; echo FOUND; command -v ‘"’"’/usr/bin/python’“'”‘; command -v ‘"’“‘python3.7’”’“'; command -v '”‘“‘python3.6’”’“'; command -v '”‘“‘python3.5’”’“'; command -v '”‘“‘python2.7’”’“'; command -v '”‘“‘python2.6’”’“'; command -v '”‘"’/usr/libexec/platform-python’“'”‘; command -v ‘"’"’/usr/bin/python3’“'”‘; command -v ‘"’“‘python’”’"‘; echo ENDFOUND && sleep 0’  
\<172.16.203.121\> Python interpreter discovery fallback (pipelining support required for extended interpreter discovery)  
Using module file /usr/lib/python3.6/site-packages/ansible/modules/network/junos/junos\_config.py  
\<172.16.203.121\> PUT /root/.ansible/tmp/ansible-local-10845\_kx\_3k77/tmps4qg\_pli TO /root/.ansible/tmp/ansible-local-10845\_kx\_3k77/ansible-tmp-1586683874.2918632-239315467988226/AnsiballZ\_junos\_config.py  
\<172.16.203.121\> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-local-10845\_kx\_3k77/ansible-tmp-1586683874.2918632-239315467988226/ /root/.ansible/tmp/ansible-local-10845\_kx\_3k77/ansible-tmp-1586683874.2918632-239315467988226/AnsiballZ\_junos\_config.py && sleep 0’  
\<172.16.203.121\> EXEC /bin/sh -c ‘/usr/bin/python /root/.ansible/tmp/ansible-local-10845\_kx\_3k77/ansible-tmp-1586683874.2918632-239315467988226/AnsiballZ\_junos\_config.py && sleep 0’  
\<172.16.203.121\> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-local-10845\_kx\_3k77/ansible-tmp-1586683874.2918632-239315467988226/ \> /dev/null 2\>&1 && sleep 0’  
[WARNING]: Platform linux on host 172.16.203.121 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python  
interpreter could change this. See [https://docs.ansible.com/ansible/2.9/reference\_appendices/interpreter\_discovery.html](https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html) for more information.  
fatal: [172.16.203.121]: FAILED! =\> {  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python”  
},  
“changed”: false,  
“module\_stderr”: “”,  
“module\_stdout”: "\n{"msg": \*\*“FileNotFoundError(2\*\*, ‘No such file or directory’)", "failed": true, "exception": "WARNING: The below traceback may _not_ be related to the actual failure.\n File \"/tmp/ansible\_junos\_config\_payload\_BA\_i4F/ansible\_junos\_config\_payload.zip/ansible/module\_utils/network/junos/junos.py\", line 97, in get\_capabilities\n capabilities = Connection(module.\_socket\_path).get\_capabilities()\n File \"/tmp/ansible\_junos\_config\_payload\_BA\_i4F/ansible\_junos\_config\_payload.zip/ansible/module\_utils/connection.py\", line 185, in **rpc** \n raise ConnectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)\n", "invocation": {"module\_args": {"comment": "Appropriate Syslog server configured", "username": null, "provider": null, "backup\_options": null, "rollback": null, "timeout": null, "src": null, "confirm": 0, "lines": ["set system syslog archive size 300000", "set system syslog archive files 3", "set system syslog archive world-readable", "set system syslog user \* any emergency", "set system syslog host 192.168.100.70 any any", "set system syslog host 192.168.100.70 interactive-commands any", "set system syslog host 192.168.100.70 facility-override local1", "set system syslog host 192.168.100.70 log-prefix firewall", "set system syslog host 192.168.100.70 source-address \"172.16.203.121\"", "set system syslog host 192.168.100.70 explicit-priority", "set system syslog file messages any critical", "set system syslog file messages authorization info", "set system syslog file default-log-messages structured-data", "set system syslog file sessions user info", "set system syslog file interactive-commands interactive-commands error"], "update": "merge", "replace": null, "confirm\_commit": false, "host": null, "zeroize": false, "src\_format": null, "ssh\_keyfile": null, "check\_commit": false, "password": null, "backup": false, "port": null, "transport": null}}}\n\n{"msg": "FileNotFoundError(2, ‘No such file or directory’)", "failed": true, "exception": "WARNING: The below traceback may _not_ be related to the actual failure.\n File \"/tmp/ansible\_junos\_config\_payload\_BA\_i4F/ansible\_junos\_config\_payload.zip/ansible/module\_utils/network/junos/junos.py\", line 97, in get\_capabilities\n capabilities = Connection(module.\_socket\_path).get\_capabilities()\n File \"/tmp/ansible\_junos\_config\_payload\_BA\_i4F/ansible\_junos\_config\_payload.zip/ansible/module\_utils/connection.py\", line 185, in **rpc** \n raise ConnectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)\n", "invocation": {"module\_args": {"comment": "Appropriate Syslog server configured", "username": null, "provider": null, "backup\_options": null, "rollback": null, "timeout": null, "src": null, "confirm": 0, "lines": ["set system syslog archive size 300000", "set system syslog archive files 3", "set system syslog archive world-readable", "set system syslog user \* any emergency", "set system syslog host 192.168.100.70 any any", "set system syslog host 192.168.100.70 interactive-commands any", "set system syslog host 192.168.100.70 facility-override local1", "set system syslog host 192.168.100.70 log-prefix firewall", "set system syslog host 192.168.100.70 source-address \"172.16.203.121\"", "set system syslog host 192.168.100.70 explicit-priority", "set system syslog file messages any critical", "set system syslog file messages authorization info", "set system syslog file default-log-messages structured-data", "set system syslog file sessions user info", "set system syslog file interactive-commands interactive-commands error"], "update": "merge", "replace": null, "confirm\_commit": false, "host": null, "zeroize": false, "src\_format": null, "ssh\_keyfile": null, "check\_commit": false, "password": null, "backup": false, "port": null, "transport": null}}}\n”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

I cannot seem to find why it is complaining about this \*\*"FileNotFoundError(2\*\*, ‘No such file or directory’)\
