Script ending after first include statement

Hi all, I have a script here with some weird behaviors that I can’t really explain.

The general layout of the script looks like this:

`

  • hosts: ‘localhost’
    tasks:
  • name: ‘launch AWS environment’
    cloudformation:
    stack_name: ‘{{ env }}’ # env is environment name, passed in via extra_vars

this script waits for SSH to come up on instances, adds IPs to known hosts, etc. based off {{ env }}

this script also calls an ec2.py refresh to make sure future host blocks can find the appropriate instances

  • include: ‘touch.yml’

these hosts definitely exist at this point

  • hosts: ‘tag_environment_{{ env }}’

do some provision work

`

For some reason, the script will properly create the environment in the first host block, then do all of the contents of touch.yml without any errors, but then it simply ends. I don’t even see a “no hosts matched” for the last host block. It’s like it didn’t try it at all.

Is something wrong with this syntax or is there a bug here?

Cheers,
Brik

For some reason, the script will properly create the environment in
the first host block, then do all of the contents of touch.yml without
any errors, but then it simply ends. I don't even see a "no hosts
matched" for the last host block. It's like it didn't try it at all.

I wonder if this is somehow related to
https://github.com/ansible/ansible/issues/20736 , which shows similar
symptoms, although the *workaround* there seemed to be to use includes
instead of blocks, so perhaps not. But this thing where it just silently
ignores some tasks is weird.

                                      -Josh (jbs@care.com)

(apologies for the automatic corporate disclaimer that follows)

This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.

Hmm, it could be related. If anything, that workaround might be enough for me now.