In that case, when running playbook3, shouldn't playbook2 be run for both 
host1 and host2?  It's only run for host1.
Cheers.

SA
--

On Tuesday, October 27, 2015 at 10:13:31 AM UTC-7, Brian Coca wrote:
>
> I would actually expect that the 2nd play in playbook2 runs for any 
> hosts that are in the precise or trusty group, this would be normal 
> behaviour as you called group_by twice and in each case inserted a 
> host into one of those groups. group_by does not delete existing hosts 
> from groups. 
>
> On Tue, Oct 27, 2015 at 12:37 PM, ttosttos <ttos...@gmail.com 
> <javascript:>> wrote: 
> > To clarify, the unexpected behavior takes place when running playbook3: 
> > 
> > Playbook3 
> > - include: playbook1.yml 
> > - include: playbook2.yml 
> > 
> > 
> > 
> > On Tuesday, October 27, 2015 at 4:44:11 AM UTC-7, ttosttos wrote: 
> >> 
> >> I'm getting unexpected results from group_by when running two playbooks 
> >> together.  I have two groups with a host each.  When I run playbook1 
> and 
> >> playbook2 separately, playbook1 is run against host1 and playbook2 is 
> run 
> >> against host2 as expected. When I include playbook1 and playbook2 in a 
> >> single playbook, both playbook1 *and* playbook2 are run against host1. 
> I'd 
> >> appreciate any suggestions.  Running  ansible 1.9.4. 
> >> 
> >> hosts 
> >> [group1] 
> >> host1 
> >> 
> >> [group2] 
> >> host2 
> >> 
> >> 
> >> Playbook1 
> >> - hosts: group1 
> >>   tasks: 
> >>     - group_by: key={{ ansible_distribution_release }} 
> >>       changed_when: False 
> >> 
> >> - hosts: precise:trusty 
> >>   gather_facts: False 
> >>   roles: 
> >>       - myrole 
> >> 
> >> Playbook2 
> >> - hosts: group2 
> >>   tasks: 
> >>     - group_by: key={{ ansible_distribution_release }} 
> >>       changed_when: False 
> >> 
> >> - hosts: precise:trusty 
> >>   gather_facts: False 
> >>   roles: 
> >>       - myrole 
> >> 
> >> 
> > -- 
> > 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-proje...@googlegroups.com <javascript:>. 
> > To post to this group, send email to ansible...@googlegroups.com 
> <javascript:>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/ee08ee09-6ec4-4d14-aaf1-2005f9176bc1%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Brian Coca 
>

-- 
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/d9775698-c0f9-426d-99e9-33696e5c9b8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to