Update first to the latest Ansible.

If you can produce this error with 1.6.5, please file a bug in GitHub, as
tracebacks are errors and need to be handled.






On Wed, Jul 9, 2014 at 10:24 AM, Alberto Losada Grande <
alosadagra...@gmail.com> wrote:

>
> Hi all,
>
> I can't find why my code is not working when running copy with another
> user than root. It works fine with root and also other modules like
> template or yum are working fine with "no root" permissions....
>
> I tried with sudo and then move to su with no luck... thanks in advance!
>
> Error:
>
> failed: [vofe4] => {"failed": true, "item": "", "md5sum":
> "99d5c87b8ae2f7cd88ed1afb47959943", "parsed": false}
> invalid output was:
> SUDO-SUCCESS-sfilimasfllysodrjbihhgpdiaurkvyn
> Traceback (most recent call last):
>   File
> "/home/alosada/.ansible/tmp/ansible-tmp-1404915322.93-16253228171966/copy",
> line 1386, in <module>
>     main()
>   File
> "/home/alosada/.ansible/tmp/ansible-tmp-1404915322.93-16253228171966/copy",
> line 213, in main
>     module.atomic_move(src, dest)
>   File
> "/home/alosada/.ansible/tmp/ansible-tmp-1404915322.93-16253228171966/copy",
> line 1237, in atomic_move
>     os.chown(tmp_dest.name, st.st_uid, st.st_gid)
> UnboundLocalError: local variable 'st' referenced before assignment
>
>
> FATAL: all hosts have already failed -- aborting
>
> My code:
>
> ansible-playbook -i production -l webservers ossec-client.yml -k -S -R
> root --ask-su-pass --tags ossec_rpm -v
>
> # file: ossec-client.yml
>
> - hosts: all
>   su: yes
>   su_user: root
>   roles:
>     - ossec-client
>
>
> # file: roles/ossec-client/tasks/main.yml
> #COPY MOD_JK
>         - name: Creates a writeable repository
>           file: path=/usr/local/src/ossec state=directory owner=alosada
> group=alosada
>           tags: ossec_rpm
>
>         - name: Copy ossec-hids-2.8-45.el6.art.x86_64.rpm compiled for
> Linux 64bits
>           copy: src=ossec-hids-2.8-45.el6.art.x86_64.rpm
> dest=/usr/local/src/ossec/ossec-hids-2.8-45.el6.art.x86_64.rpm
>           tags: ossec_rpm
>
> Version: ansible 1.6 (devel bb723bedee) last updated 2014/03/24 16:53:13
> (GMT +200)
>
>  --
> 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-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e3a4acf9-7dcc-4b7f-93a8-1bc488d958bb%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/e3a4acf9-7dcc-4b7f-93a8-1bc488d958bb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxEDAt2UAWppZLX-PYbs9Jzp0tD%3D90%2BnSXrKJFxRWPq4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to