Hi, 

ok now I try to develop a custom filter. Now my problem is that I am not 
very familiar with python.

What I try to do is to handover Python an multimensional array of artifacts 
and a string variable named env which contains for example "at". 
Each element of the array has 3 keys (artifactId, version and extension) 
with respectively 3 values.

Then I like to iterate over this array and find out which of the array 
elements has an artifactId that contains "atmyartifact-properties".
If the artifactId of an element contains "atmyartifact-properties" I like 
to add it to a new array.

That's all. 
I hope someone with Python skills could give me a code snippet to put my 
plan into action?  



Am Donnerstag, 7. September 2017 16:57:10 UTC+2 schrieb James Tanner:
>
> Calling set_fact with an item loop is not going to slice the original 
> list. Your best best is to make a custom filter plugin to handle this.
>
> An example might look like:
>
> - set_fact:
>      newlist: "{{ bundle_artifacts|artifact_reduce(product, env) }}"
>
>
>
> http://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#filter-plugins
>
>
> On Thu, Sep 7, 2017 at 10:47 AM, 'Tom Bartsch' via Ansible Project <
> [email protected] <javascript:>> wrote:
>
>> Has anybody an idea or is this impossible?
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/baae668e-5ee9-4a7e-89b3-f6a5ba8da10e%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/baae668e-5ee9-4a7e-89b3-f6a5ba8da10e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/cfdc5ddf-50b5-4dfd-8e40-d4ef3792e8ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to