Hi,

Please make sure you are on the most recent version of Ansible if asking
questions to this list.  Many things have changed or been improved in
various releases, and it's quick to upgrade.

The current latest version is 1.7.1.

I believe the chown attempts as non-root has already been addressed.




On Wed, Aug 27, 2014 at 8:16 PM, Jon Forrest <[email protected]> wrote:

> This one fooled me for a little while because I wasn't paying attention
> (Ansible 1.6.6).
>
> I ran
>
> % ansible machine -m file -a 'path=/tmp/jon state=touch mode=0644
> owner=root'
>
> The file '/tmp/jon' was created, but Ansible returned
>
> ansible | FAILED >> {
>     "failed": true,
>     "gid": 1000,
>     "group": "jonf",
>     "mode": "0664",
>     "msg": "chown failed",
>     "owner": "jonf",
>     "path": "/tmp/jon",
>     "size": 0,
>     "state": "file",
>     "uid": 1000
> }
>
> The "FAILED" fooled me, since the file was created. Then I noticed the
> "chown failed" message. This was caused by the fact that the remote user
> isn't root so it can't change owner.
>
> I was hoping that a simple command like this would either completely
> succeed or completely fail. If it fails, it shouldn't change the state of
> the system it's running on. Instead, it leaves '/tmp/jon' in place, but it
> isn't owned by the specified user.
>
> One could argue that the file module should fail without doing anything if
> it's told to change ownership of a file, and the module isn't being run as
> root.
>
> Jon
>
> --
> 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/c984eb3b-5ad0-4d4c-838f-d634dc482d65%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c984eb3b-5ad0-4d4c-838f-d634dc482d65%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 [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/CA%2BnsWgzodU85PpafHkphfnJKkY6%3DtSc8S%2BH%3D5SkZ4nkp3HDWdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to