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