OK ... found the issue:
var=production.clients.default.hosts[0].split(':')

Works.

thanks again to Matt Martz for the tip some_var.split(':')[0]

On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote:
>
> Hi,
>
> if I have a string/var  with hostname_01.com:28569, how can I use the 
> hostname part (hostname_01 and don"t use the :28569)  to be use in an 
> action ?
>
> Regards,
>
>
-- 


------------------------------

This email is sent on behalf of Northgate Information Solutions Limited and 
its associated companies ("Northgate") and is strictly confidential and 
intended solely for the addressee(s). 

If you are not the intended recipient of this email you must: (i) not 
disclose, copy or distribute its contents to any other person nor use its 
contents in any way or you may be acting unlawfully;  (ii) contact 
Northgate immediately on +44 (0)1442 232424 quoting the name of the sender 
and the addressee then delete it from your system.

Northgate has taken reasonable precautions to ensure that no viruses are 
contained in this email, but does not accept any responsibility once this 
email has been transmitted.  You should scan attachments (if any) for 
viruses.
------------------------------

-- 
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/cebca521-8505-429d-ab3a-ef1a58fd9ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to