I know it's not really a direct answer to your question but maybe you can 
try to update to a newer ansible version, e.g. 1.4.4. This solved some 
issues on my side with unarchive.

Am Mittwoch, 4. Dezember 2013 16:01:45 UTC+1 schrieb Steven Haddox:
>
> I'm getting a really weird / hard to interpret error from the unarchive 
> module with Ansible 1.4.1. The following code:
>
> #provisioning/roles/common/tasks/upload_src.yml
>  
> # Set src filename
> - name: Set source file & directory name
>   command: echo 
> "{{package.prefix}}{{package.name}}-{{package.ver}}{{package.suffix}}.{{package.ext}}"
>   register: src_file_name
>   changed_when: false
>  
> - command: echo 
> "{{package.prefix}}{{package.name}}-{{package.ver}}{{package.suffix}}"
>   register: src_folder
>   changed_when: false
>  
> - name: Create {{package.name}} src directory
>   when: pkg_check.stat.exists == false
>   command: mkdir -p {{SRC_PATH}}/{{src_folder.stdout}} 
> creates={{SRC_PATH}}/{{src_folder.stdout}}
>  
> - name: Copy {{package.name}} src file to remote node
>   when: pkg_check.stat.exists == false
>   unarchive: src={{LOCAL_SRC_PATH}}/{{src_file_name.stdout}} 
> dest={{SRC_PATH}}/{{src_folder.stdout}}
>  
> - debug: msg="Source file => {{LOCAL_SRC_PATH}}/{{src_file_name.stdout}}"
>
> Is throwing the following error:
>
> TASK: [python | Copy Python src file to remote node] 
> **************************
> <33.33.33.10> ESTABLISH CONNECTION FOR USER: vagrant
> <33.33.33.10> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 
> 'ControlPersist=60s', '-o', 
> 'ControlPath=/Users/steven/.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=vagrant', '-o', 
> 'ConnectTimeout=10', '33.33.33.10', "/bin/sh -c 'mkdir -p 
> /tmp/ansible-1386166165.17-8441065472541 && chmod a+rx 
> /tmp/ansible-1386166165.17-8441065472541 && echo 
> /tmp/ansible-1386166165.17-8441065472541'"]
> <33.33.33.10> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 
> 'ControlPersist=60s', '-o', 
> 'ControlPath=/Users/steven/.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=vagrant', '-o', 
> 'ConnectTimeout=10', '33.33.33.10', u'/bin/sh -c \'sudo -k && sudo -H -S -p 
> "[sudo via ansible, key=cpfedfluyenfmeziurubqlmbuoputnem] password: " -u 
> sysadmin /bin/sh -c \'"\'"\'echo 
> SUDO-SUCCESS-cpfedfluyenfmeziurubqlmbuoputnem; rc=0; [ -r 
> "/home/sysadmin/SUPPORT/src/Python-2.7.6" ] || rc=2; [ -f 
> "/home/sysadmin/SUPPORT/src/Python-2.7.6" ] || rc=1; [ -d 
> "/home/sysadmin/SUPPORT/src/Python-2.7.6" ] && rc=3; (/usr/bin/md5sum 
> /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (/sbin/md5sum -q 
> /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (/usr/bin/digest -a 
> md5 /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (/sbin/md5 -q 
> /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (/usr/bin/md5 -n 
> /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (/bin/md5 -q 
> /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (/usr/bin/csum -h MD5 
> /home/sysadmin/SUPPORT/src/Python-2.7.6 2>/dev/null) || (echo "${rc}  
> /home/sysadmin/SUPPORT/src/Python-2.7.6")\'"\'"\'\'']
> <33.33.33.10> PUT 
> /Users/steven/Sites/work/ansible_provisioning/provisioning/src_files/Python-2.7.6.tgz
>  TO /tmp/ansible-1386166165.17-8441065472541/source
> <33.33.33.10> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 
> 'ControlPersist=60s', '-o', 
> 'ControlPath=/Users/steven/.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=vagrant', '-o', 
> 'ConnectTimeout=10', '33.33.33.10', "/bin/sh -c 'chmod a+r 
> /tmp/ansible-1386166165.17-8441065472541/source'"]
> <33.33.33.10> PUT /var/folders/zh/_tr32h210nd5vtcyhljkv4pm0000gp/T/tmpH_tWgb 
> TO /tmp/ansible-1386166165.17-8441065472541/unarchive
> <33.33.33.10> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 
> 'ControlPersist=60s', '-o', 
> 'ControlPath=/Users/steven/.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=vagrant', '-o', 
> 'ConnectTimeout=10', '33.33.33.10', "/bin/sh -c 'chmod a+r 
> /tmp/ansible-1386166165.17-8441065472541/unarchive'"]
> <33.33.33.10> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 
> 'ControlPersist=60s', '-o', 
> 'ControlPath=/Users/steven/.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=vagrant', '-o', 
> 'ConnectTimeout=10', '33.33.33.10', u'/bin/sh -c \'sudo -k && sudo -H -S -p 
> "[sudo via ansible, key=irrzxaqmwoaqvfkgrmqckeynvlsczmex] password: " -u 
> sysadmin /bin/sh -c \'"\'"\'echo 
> SUDO-SUCCESS-irrzxaqmwoaqvfkgrmqckeynvlsczmex; /usr/bin/python 
> /tmp/ansible-1386166165.17-8441065472541/unarchive\'"\'"\'\'']
> <33.33.33.10> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 
> 'ControlPersist=60s', '-o', 
> 'ControlPath=/Users/steven/.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=vagrant', '-o', 
> 'ConnectTimeout=10', '33.33.33.10', "/bin/sh -c 'rm -rf 
> /tmp/ansible-1386166165.17-8441065472541/ >/dev/null 2>&1'"]
> changed: [33.33.33.10] => {"changed": true, "check_results": {"bool": false, 
> "cmd": "tar -v -C \"/home/sysadmin/SUPPORT/src/Python-2.7.6\" --diff -zf 
> \"/tmp/ansible-1386166165.17-8441065472541/source\"", "err": "tar: Cannot 
> save working directory\ntar: Error is not recoverable: exiting now\n\ngzip: 
> stdout: Broken pipe\n", "out": "", "rc": 2}, "dest": 
> "/home/sysadmin/SUPPORT/src/Python-2.7.6", "gid": 504, "group": "sysadmin", 
> "handler": "_tgzfile", "item": "", "mode": "0755", "owner": "sysadmin", 
> "secontext": "user_u:object_r:user_home_t:s0", "size": 4096, "src": 
> "/tmp/ansible-1386166165.17-8441065472541/source", "state": "directory", 
> "uid": 501}
>  
> TASK: [python | debug msg="Source file => 
> {{LOCAL_SRC_PATH}}/{{src_file_name.stdout}}"] ***
> <33.33.33.10> ESTABLISH CONNECTION FOR USER: vagrant
> ok: [33.33.33.10] => {
>     "item": "",
>     "msg": "Source file => 
> ~/Sites/work/ansible_provisioning/provisioning/src_files/Python-2.7.6.tgz"
> }
>
> I've verified that changing the name / path of the source file throws a file 
> not found error so I know it's getting the proper file, but I'm not sure why 
> tar isn't extracting it properly (or even what it's trying to do and failing 
> on honestly)?
>
> Any ideas would be greatly appreciated as I'd love to use the unarchive 
> module vs manually copying the file and then extracting it myself in my shell 
> command.
>
> Thanks,
>
> Steven
>
>

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to