Since build_soft.yml is a full playbook and not just a list of tasks, like
set_os.yml, the include shouldn't be indented to the same level. Try
de-denting the build_soft.yml as far left as possible, and it should behave
as expected.

-Tim

On Thu, Nov 19, 2015 at 6:58 PM, Slim Slam <[email protected]> wrote:

> Ansible v1.9.4
>
> I have a playbook that I launch with:
>
> $ ansible-playbook build.yml
>
> build.yml includes set_os.yml (just a set of tasks) that launches some ec2
> instances. build.yml looks like this.
>
> - name: Build stuff
>   hosts: localhost
>   remote_user: ec2-user
>   sudo: False
>   gather_facts: False
>   tasks:
>     - include: set_os.yml
>     - include: build_soft.yml
>
> At the end of build.yml above, I also include build_soft.yml which is
> another playbook:
>
> ---
> - name: Configure the EC2 instance
>   hosts: ec2hosts
>   gather_facts: true
>   tasks:
>     - do something......
>
> Although I've seen examples of multiple plays, Ansible doesn't seem to
> like this way of including
> plays and immediately exists with:
>
> ERROR: gather_facts [or hosts or tasks] is not a legal parameter in an
> Ansible task or handler
>
> I need to immediately start configuring my new EC2 instances that have
> been stored in the "ec2hosts" group var.
> Is this way of nesting plays not supported or am I making a mistake
> somewhere else?
>
> -J
>
>
>
>
> --
> 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/eb1ca398-2fa6-46dd-bf59-e52efd7f28f3%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/eb1ca398-2fa6-46dd-bf59-e52efd7f28f3%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/CAH4wdVX9HqYFMjTssaghU2CyZ4numXCZjtvCq5zL-Ztc0ftsmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to