title: Ansible - playbook calls another playbook with variables, tags, and limits
body: <p>I have a blue green deploy playbook. It relies on certain variables to determine which hosts to apply the underlying roles. Here is one of the roles for an example:</p>
  
  <pre><code>- name: Remove current server from load balancer
    hosts: 'tag_Name_{{server_name}}_production'
    remote_user: ec2-user
    sudo: true
    roles:
      - remove-load-balancer
  </code></pre>
  
  <p>I can call this playbook with specified limits and tags and it works wonderfully - but only for one type of server. For example, this command will blue green deploy our services servers:</p>
  
  <pre><code>ansible-playbook blue.green.yml -i ec2.py -l tag_Name_services_production,tag_Name_services_production_old --skip-tags=restart,stop -e server_name=services -e core_repo=~/core
  </code></pre>
  
  <p>I would like to write a master blue green playbook which essentially runs several playbooks - first for the api servers and then for the services servers. I have tried using includes but cannot seem to get the syntax right - ansible either complains that my task doesn't do anything or complains that the syntax is incorrect:</p>
  
  <hr>
  
  <pre><code>- name: Blue green deploy to all production boxes.
    hosts: localhost
    tasks:
    - include: blue.green.single.yml
      hosts:
      - tag_Name_api_production
      - tag_Name_api_production_old
      vars:
      - server_name: api
      skip-tags:
      - restart
      - stop
  
    - include: blue.green.single.yml
      hosts:
      - tag_Name_services_production
      - tag_Name_services_production_old
      vars:
      - server_name: services
      skip-tags:
      - restart
      - stop
  </code></pre>
  
  <p>Ideally I'd be able to call this like so:</p>
  
  <pre><code>ansible-playbook blue.green.yml -i ec2.py -e core_repo=~/core
  </code></pre>
  
  <p>Has anyone done this successfully? If so - how can I accomplish this?</p>