See what Brian said in this very thread about setting "remote_user" on the
task.





On Sat, Jan 4, 2014 at 10:21 PM, Ken Lemoine <[email protected]> wrote:

> I'd be interested.  Cannot seem to find a way to use delegate_to with a
> different username.  Has anyone figured out a  workaround?
>
>
> On Monday, November 25, 2013 10:05:43 AM UTC-8, Joshua Swink wrote:
>>
>> Is there a way to indicate the remote username when using delegate_to?
>> I'm trying to use the Nagios plugin, but it tries to log in to the Nagios
>> server as the name of the user on the service host. Here's my example
>> recipe for shutting down a service:
>>
>> ---
>> - hosts: abc_hosts
>>   serial: 1
>>   tasks:
>>   - name: Disable Nagios alerts
>>     nagios: host={{ ansible_ssh_host }} action=silence
>>     delegate_to: nagios.myplace.xyz
>>   - name: Disable ABC service
>>     shell: service ABC stop
>>
>> If the username on abc_hosts is "abc" and the username on the Nagios
>> server is "nagios", the plugin will try to log in to nagios.myplace.xyz as
>> "abc". I need it to use user "nagios" here.
>>
>  --
> 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.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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