thank you I will have a look at your solution, I finally found this way to 
proceed otherwise:
   - set_fact:
       services: "{{ services }} + SRV{{item }}"
     with_sequence: count=5

   - set_fact:
      distrib: "{{ distribsrv }}"
     when: dual in services

TASK [debug] 
*******************************************************************
ok: [SRV1] => {
    "msg": "sequence SRV + SRV1 + SRV2 + SRV3 + SRV4 + SRV5"
}


Le mardi 7 février 2017 14:45:44 UTC+1, fanvalt a écrit :
>
> Hello,
>
> Actually I wrote my playbook this way to set values id the dual variable 
> is the string value SRV:
>
>    - set_fact:
>       distrib: "{{ distribsrv }}"
>       Directoryname: "{{ Directorysrv }}"
>      when: dual == 'SRV'
>
> I would like to modify the when condition to run it when dual == 'SRV1', 
> "SRV2' ... etc, is there a way to do a when condition : when : dual like 
> 'SRV*' ?
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e47e93e2-f8d5-4805-a297-95bb5a24871b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to