*Hi,*


*I'm kinda new to ansible seeking helop with below scenario. what I'm 
trying to do is iterate over the array '*access_key_ids*' and run 
regex_search filter. for the regex_search filter argument is 'item' which 
is the variable from with_items. It does not work this way below is what 
I'm trying.  *


*name: *Set Fatcs

  

*block:    *

*# extract access key ids from get event response    *- 

*set_fact:       event_response_access_key_ids: 
*"{{event_response_access_key_ids}} 
+ [{{event_response.content | regex_search(item)}}]"

     *with_items: *"{{access_key_ids}}"

   

*# check if the response contains access key id for the license    *- 

*set_fact:       scwx_output: *"{{ (event_response_access_key_ids | length 
> 0 ) | ternary(event_response, 'License Key does not match with available 
sensors')}}"

  *when: *event_response.json is undefined 



*It gives* *event_response_access_key_ids as empty. but when I **hard code** a 
value instead of 'item' it works*


*Thanks.*

-- 
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/31f195f7-fe1e-4423-90f0-396d3b114fb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to