# Can't execute reomte script

**URL:** <https://forum.ansible.com/t/cant-execute-reomte-script/20339>\
**Category:** Ansible Project\
**Created:** [January 25, 2016, 2:48pm UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339 "2016-01-25T14:48:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christophe\_Dumont](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Christophe\_Dumont](https://forum.ansible.com/u/Christophe_Dumont)\
**Post date:** [January 25, 2016, 2:48pm UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/1 "2016-01-25T14:48:38Z")

</div>

Hello,

I got two script the first one :  
start\_jmeter\_server\_remote.yml :  
_ **- hosts: JMETER\_REMOTE\_VM** _  
_ **sudo: True** _  
_ **user: simsu** _  
_ **tasks:** _

_ **- command: start\_jmeter.sh** _  
_ **args:** _  
_ **chdir: /usr/local/jmeter/apache-jmeter-2.13/bin/** _

is ment to start jmeter on remote host, but doesn’t work !

start\_jmeter.sh :  
_ **#!/bin/bash** _  
_ **/usr/local/jmeter/apache-jmeter-2.13/bin/jmeter-server &** _

failed: [130.190.250.66] =\> {“cmd”: “start\_jmeter.sh”, “failed”: true, “rc”: 2}  
msg: [Errno 2] No such file or directory

FATAL: all hosts have already failed – aborting

christophe

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 25, 2016, 8:17pm UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/2 "2016-01-25T20:17:44Z")

</div>

you need to give it the full path to start\_jmeter.sh

---

<div class="post-metadata">

**Author:** ![Christophe\_Dumont](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Christophe\_Dumont](https://forum.ansible.com/u/Christophe_Dumont)\
**Post date:** [January 26, 2016, 8:00am UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/3 "2016-01-26T08:00:05Z")

</div>

I changed the first script to :

**_- hosts: JMETER\_REMOTE\_VM_**  
**_sudo: True_**  
**_user: simsu_**  
**_gather\_facts: False_**  
**_tasks:_**  
**_- command: /usr/local/jmeter/apache-jmeter-2.13/bin/start\_jmeter.sh_**  
**_args:_**  
**_chdir: /usr/local/jmeter/apache-jmeter-2.13/bin/_**

still doesn’t start jmeter on remote host !

---

<div class="post-metadata">

**Author:** ![Alex\_Leonhardt](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Alex\_Leonhardt](https://forum.ansible.com/u/Alex_Leonhardt)\
**Post date:** [January 26, 2016, 8:32am UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/4 "2016-01-26T08:32:14Z")

</div>

Try shell: instead, you might need that… Also make sure it’s executable… (Stating the obvious) …

Alex

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 26, 2016, 3:10pm UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/5 "2016-01-26T15:10:45Z")

</div>

also it will be helpful if you post the output of the task

---

<div class="post-metadata">

**Author:** ![Christophe\_Dumont](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Christophe\_Dumont](https://forum.ansible.com/u/Christophe_Dumont)\
**Post date:** [January 27, 2016, 8:59am UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/6 "2016-01-27T08:59:45Z")

</div>

ansible-playbook start\_jmeter\_server\_remote\_1.yml --ask-sudo-pass -vvvv

SUDO password:

PLAY [JMETER\_REMOTE\_VM] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\<130.190.250.66\> ESTABLISH CONNECTION FOR USER: simsu

\<130.190.250.66\> REMOTE\_MODULE setup

\<130.190.250.66\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/root/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=simsu -o ConnectTimeout=10 130.190.250.66 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1453882475.17-68023331377793 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1453882475.17-68023331377793 && echo $HOME/.ansible/tmp/ansible-tmp-1453882475.17-68023331377793’

\<130.190.250.66\> PUT /tmp/tmpijHPWy TO /home/simsu/.ansible/tmp/ansible-tmp-1453882475.17-68023331377793/setup

\<130.190.250.66\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/root/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=simsu -o ConnectTimeout=10 130.190.250.66 /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=zowdykhpfmzccljfrohbyspkgyhejhqj] password: " -u root /bin/sh -c '”’“‘echo BECOME-SUCCESS-zowdykhpfmzccljfrohbyspkgyhejhqj; LANG=C LC\_CTYPE=C /usr/bin/python /home/simsu/.ansible/tmp/ansible-tmp-1453882475.17-68023331377793/setup; rm -rf /home/simsu/.ansible/tmp/ansible-tmp-1453882475.17-68023331377793/ \>/dev/null 2\>&1’”‘"’’

ok: [130.190.250.66]

TASK: [command /usr/local/jmeter/apache-jmeter-2.13/bin/start\_jmeter.sh] \*\*\*\*\*\*

\<130.190.250.66\> ESTABLISH CONNECTION FOR USER: simsu

\<130.190.250.66\> REMOTE\_MODULE command chdir=/usr/local/jmeter/apache-jmeter-2.13/bin/ /usr/local/jmeter/apache-jmeter-2.13/bin/start\_jmeter.sh

\<130.190.250.66\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/root/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=simsu -o ConnectTimeout=10 130.190.250.66 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1453882477.7-240100734924544 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1453882477.7-240100734924544 && echo $HOME/.ansible/tmp/ansible-tmp-1453882477.7-240100734924544’

\<130.190.250.66\> PUT /tmp/tmp2aAt4A TO /home/simsu/.ansible/tmp/ansible-tmp-1453882477.7-240100734924544/command

\<130.190.250.66\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/root/.ansible/cp/ansible-ssh-%h-%p-%r” -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=simsu -o ConnectTimeout=10 130.190.250.66 /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=zqnpetjkcglujinqbfeuiqaspgfrjfgc] password: " -u root /bin/sh -c '”’“‘echo BECOME-SUCCESS-zqnpetjkcglujinqbfeuiqaspgfrjfgc; LANG=C LC\_CTYPE=C /usr/bin/python /home/simsu/.ansible/tmp/ansible-tmp-1453882477.7-240100734924544/command; rm -rf /home/simsu/.ansible/tmp/ansible-tmp-1453882477.7-240100734924544/ \>/dev/null 2\>&1’”‘"’’

changed: [130.190.250.66] =\> {“changed”: true, “cmd”: [“/usr/local/jmeter/apache-jmeter-2.13/bin/start\_jmeter.sh”], “delta”: “0:00:01.810392”, “end”: “2016-01-27 09:29:35.613533”, “rc”: 0, “start”: “2016-01-27 09:29:33.803141”, “stderr”: “”, “stdout”: “Created remote object: UnicastServerRef [liveRef: [endpoint:130.190.250.66:50469,objID:[-cba3997:1528233bbad:-7fff, -4566448809460184707]]]”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
130.190.250.66 : ok=2 changed=1 unreachable=0 failed=0

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 27, 2016, 5:37pm UTC](https://forum.ansible.com/t/cant-execute-reomte-script/20339/7 "2016-01-27T17:37:50Z")

</div>

so no errors on execution of the script, I don't think the issue is  
with ansible at this point.
