I get permission denied when using script module. I can copy the shell 
script over and execute. I also can see that the temp folder ansible uses 
is successfully being created. I added a wait_for: timeout=30 to see if it 
was failing to create files in the tmp, but the wait_for python script 
showed up on the host.


*[14:30:35] tigh:~/.ansible/tmp/ansible-tmp-1452626878.29-116073172291284 # 
*ll

total 84

-rw------- 1 root root 79521 Jan 12 14:27 wait_for


The most obvious difference between the working hosts and the ones it fails 
on are that the ones it fails on require scp instead of sftp. I was 
wondering if script ignores scp_if_ssh=True, however I couldn't find where 
the actual action is in ansible code. here is a link to the script 
<https://github.com/ansible/ansible-modules-core/blob/devel/commands/script.py>
 module. 


If anyone can help or point me to a location to search deeper I would 
appreciate it!




Information follows:


test.yml

______________________________________

---


- hosts: cds

  vars:

    svcauto: 172.16.116.150

  tasks:

  - name: test delegate script

    script: version.sh

    register: hey

    delegate_to: "{{svcauto}}"

    changed_when: false


#  - debug: var=hey


  - copy: src=version.sh dest=/home/root/version.sh owner=root group=root 
mode="u=rwx,g=r,o=r"


  - shell: /home/root/version.sh

    changed_when: false


  - name: run svc install

    script: version.sh  #svc_iso_install.sh

    register: versions


  - debug: var=versions


______________________________________


Output:


$ ansible-playbook -l tigh test.yml 


PLAY [cds] 
******************************************************************** 


GATHERING FACTS 
*************************************************************** 

ok: [tigh]


TASK: [test delegate script] 
************************************************** 

ok: [tigh -> 172.16.116.150]


TASK: [copy src=version.sh dest=/home/root/version.sh owner=root group=root 
mode="u=rwx,g=r,o=r"] *** 

ok: [tigh]


TASK: [shell /home/root/version.sh] 
******************************************* 

ok: [tigh]


TASK: [run svc install] 
******************************************************* 

failed: [tigh] => {"changed": true, "rc": 126}

stderr: OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011

debug1: Reading configuration data /etc/ssh_config

debug1: /etc/ssh_config line 20: Applying options for *

debug1: auto-mux: Trying existing master

debug1: mux_client_request_session: master session id: 2

Shared connection to tigh closed.


stdout: bash: 
/home/root/.ansible/tmp/ansible-tmp-1452626758.09-265659951753804/version.sh: 
Permission denied



FATAL: all hosts have already failed -- aborting


PLAY RECAP 
******************************************************************** 

           to retry, use: --limit @/Users/brianwilliams/test.retry


tigh                       : ok=4    changed=0    unreachable=0    failed=1  
 


______________________________________


Thanks,

Brian

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cabe715c-bd59-4268-9ea9-10af5c886e3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to