Can't execute reomte script

61 views
Skip to first unread message

Christophe Dumont

unread,
Jan 25, 2016, 9:48:38 AM1/25/16
to Ansible Project
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

Brian Coca

unread,
Jan 25, 2016, 3:17:56 PM1/25/16
to Ansible Project
you need to give it the full path to start_jmeter.sh


--
Brian Coca

Christophe Dumont

unread,
Jan 26, 2016, 3:00:05 AM1/26/16
to Ansible Project
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 !

Alex Leonhardt

unread,
Jan 26, 2016, 3:32:22 AM1/26/16
to ansible...@googlegroups.com

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

Alex

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ea3aeb89-895b-4ce7-933e-ac2de0761518%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Coca

unread,
Jan 26, 2016, 10:10:56 AM1/26/16
to Ansible Project
also it will be helpful if you post the output of the task
> https://groups.google.com/d/msgid/ansible-project/CACSH3MvRNgWgo9A8FtvDhoQ65403eJ77N4PO1NNSKg%2BHxPA-4Q%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

Christophe Dumont

unread,
Jan 27, 2016, 3:59:45 AM1/27/16
to Ansible Project
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](local),objID:[-cba3997:1528233bbad:-7fff, -4566448809460184707]]]"}

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

Brian Coca

unread,
Jan 27, 2016, 12:38:04 PM1/27/16
to Ansible Project
so no errors on execution of the script, I don't think the issue is
with ansible at this point.


--
Brian Coca
Reply all
Reply to author
Forward
0 new messages