On 11/23/20 1:19 PM, blue fox wrote:
> I like to make a loop for a role , each time he copie each host in file
> 
> example:
> ------------------
> hosts file
> 
> webserver]
> 
> 10.10.10.10
> 
> 20.20.20.20
> 
> ---------------------
> turn 1 for loop: copie   10.10.10.10.  in file and send it to distant server
> 
> turn 2 for loop: copie   20.20.20.20.  in file and send it to distant server
> 
> Thank you

So you want to execute the role only for members of webserver group?

If so you can add the following condition:

    when: "'webserver' in group_names"

Regards
         Racke

> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/01483a96-5a98-42d7-ac0b-aed2a60d4593n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/01483a96-5a98-42d7-ac0b-aed2a60d4593n%40googlegroups.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/db94446b-333d-d1b4-b03a-a4b732e1c840%40linuxia.de.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to