Hi,

Are you saying to want to run the 'vncserver' command as each user? Does 
this work:

 - name: VNC | vncserver command
   shell: sudo -u {{item}} vncserver </tmp/file >/tmp/vncpasswd.1 2>/tmp/
vncpasswd.2
   with_items:
       vnc_users

What have you tried so far, and what were the results?

On Monday, 2 February 2015 16:49:58 UTC, Arbab Nazar wrote:
>
> Hi I am new to ansible and stuck here, where i want to run this same 
> command but using the each user from the list. 
>
> for example:
>
> in vars/main.yml
>   vpc_users:
>       - abc
>       - xyz
>       - qes
>
> in tasks/main.yml
>  - name: VNC | vncserver command
>    shell: vncserver </tmp/file >/tmp/vncpasswd.1 2>/tmp/vncpasswd.2
>    remote_user/sudo_user or somethine else?
>    with_items:
>        vnc_users
>
> Thanks in advance
>

-- 
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/3b84d110-e1eb-4146-b503-b73e260c91a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to