Hi there,

I have the following playbook:

---
- hosts: "{{ host }}"
  vars:
    bundle_artifacts:
      - artifactId: "someArtifact"
        version: "1.0.0"
        extension: "zip"
      - artifactId: "kietmyartifact-properties"
        version: "5.0.0"
        extension: "jar"
      - artifactId: "kiatmyartifact-properties"
        version: "5.0.0"
        extension: "jar"
      - artifactId: "kiprmyartifact-properties"
        version: "5.0.0"
        extension: "jar"

  tasks:
  - set_fact:
      bundle_artifacts_without_non_current_env_properties: "{{ 
(bundle_artifacts_without_non_current_env_properties | default([])) + 
[{'artifactId':item.artifactId, 
'version':item.version,'extension':item.extension}] }}"
    with_items: "{{ bundle_artifacts }}"
    when: ('"{{ product }}-properties" not in item.artifactId') or ('"{{ env 
}}{{ product }}-properties" in item.artifactId')



env is a property that depends on the host the execution is for. Values of env 
could be: et, at, qs or pr.
product is a property that depends on the host the execution is for too. Assume 
the value is here: myartifact


Now my problem is that after executing the task above 
bundle_artifacts_without_non_current_env_properties contains the same elements 
like bundle_artifacts.

I would like to have the following artifacts in 
bundle_artifacts_without_non_current_env_properties if product was "myartifact" 
and env was "at":

someArtifact and kiatmyartifact-properties.

The artifacts kietmyartifact-properties and kiprmyartifact-properties should be 
ignored.


Does anybody know what I have to do to get this work?

Regards,
Tom

-- 
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/a3412494-2ab0-497a-be17-884c3681f017%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to