For that machine it should be ['catalogue', 'catalogue-db', 'feeds-db',
'fulfilment', 'fulfilment-db', 'ungrouped'].
I don't know why 'ungrouped' ends up on there, it isn't something I added,
but I see it appear in earlier steps.
On Wednesday, 21 January 2015 04:58:12 UTC+10, James Martin wrote:
>
> What does your group_names variable look like?
>
> On Tuesday, January 20, 2015 at 2:01:56 AM UTC-5, Lyle Dietz wrote:
>>
>> I'm trying to deploy specific Java EE EARs to a host based on what groups
>> that host is in.
>>
>> Each EAR goes in to it's own deployable directory because we're running
>> each application component in it's own container.
>>
>> What I have is:
>>
>> - name: Copy EAR
>> copy:
>> src: "{{ maven }}/au/com/company/{{ item.1.name }}/{{
>> item.1.version }}/{{ item.1.name }}-{{ item.1.version }}.ear"
>> dest: /opt/company/{{ item.0.name }}/deployments/{{ item.1.name
>> }}.ear
>> with_subelements:
>> - deployables
>> - ears
>> when: item.0.name in group_names
>>
>> with the variables file containing:
>>
>> maven: "{{ lookup('env', 'HOME') }}/.m2/repository"
>>
>> deployables:
>> - application: catalogue
>> ears:
>> - { name: 'catalogue-ear', version: '0.2.0-SNAPSHOT' }
>>
>> which gives the error:
>>
>> fatal: [local-int] => error while evaluating conditional: item.0.name
>> in group_names
>>
>> What I had hoped would happen is if this host is in the catalogue group
>> then the catalogue EAR would be copied in to the specified directory.
>>
>> Is the 'in' operator not supported here, or am I missing something really
>> obvious? Is there a better way to do this?
>>
>> Thanks,
>>
>> Lyle
>>
>
--
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/e5fdc8e7-fea5-424d-b81a-669a3878810c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.