# How to run a symbolic link by module command?

**URL:** <https://forum.ansible.com/t/how-to-run-a-symbolic-link-by-module-command/27042>\
**Category:** Ansible Project\
**Created:** [March 19, 2018, 4:44pm UTC](https://forum.ansible.com/t/how-to-run-a-symbolic-link-by-module-command/27042 "2018-03-19T16:44:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHEN\_YANQING](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CHEN\_YANQING](https://forum.ansible.com/u/CHEN_YANQING)\
**Post date:** [March 19, 2018, 4:44pm UTC](https://forum.ansible.com/t/how-to-run-a-symbolic-link-by-module-command/27042/1 "2018-03-19T16:44:54Z")

</div>

Hello,

As a beginner of ansible, I tried to run my script test.sh (which is a symbolic link) by le bloc in my playbook:

- hosts: my\_host  
become: true  
become\_user: root  
tasks:
- name: my test  
command: /xxx/xx/test.sh

But I got an errer as followed:  
fatal: [xxxxxx]: FAILED! =\> {“changed”: false, “cmd”: “/xxx/xx/test.sh”, “failed”: true, “msg”: “[Errno 2] No such file or directory”, “rc”: 2}

Could anyone help? How could we run a symbolic link on a remote node by command (or another mudule if possible) ?  
Thanks a lot,

---

<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:** [March 19, 2018, 5:00pm UTC](https://forum.ansible.com/t/how-to-run-a-symbolic-link-by-module-command/27042/2 "2018-03-19T17:00:12Z")

</div>

Ansible command module does follow symlinks, so you must have some error in the linking.
