---

# Returns 'ansible_aws_params_file' which is where future playbooks can load params
- name: Load AWS config params
  include: ansible_aws_load_config.yml
  when: ansible_aws_load_config

- name: Login to AWS ECR
  include: ansible_aws_login_to_ecr.yml
  when: ansible_aws_login_to_ecr

# Bring up the instances we care about
- name: Launch any instances that we need
  include: ansible_aws_launch_instances.yml
  when: ansible_aws_launch
  with_items: "{{ ansible_aws_server_subtypes | default(['default']) }}"
  loop_control:
    loop_var: ansible_aws_server_subtype

# Find all the currently running instances
- name: Get info about all the currently running instances
  include: ansible_aws_get_instances.yml
  when: ansible_aws_get_info
  vars:
    ansible_aws_state: running

# Push repos to ECR
- name: Push repos to ECR
  include: ansible_aws_push_to_ecr.yml
  when: ansible_aws_push_to_ecr
  vars:
    ansible_aws_state: running
---

# Returns 'ansible_aws_params_file' which is where future playbooks can load params
- name: Load AWS config params
  include: ansible_aws_load_config.yml
  when: ansible_aws_load_config
  with_items: "{{ ansible_aws_config_files | default([]) }}"
  loop_control:
    loop_var: ansible_aws_config_file

- name: Login to AWS ECR
  include: ansible_aws_login_to_ecr.yml
  when: ansible_aws_login_to_ecr

# Bring up the instances we care about
- name: Launch any instances that we need
  include: ansible_aws_launch_instances.yml
  when: ansible_aws_launch
  with_items: "{{ ansible_aws_server_subtypes | default(['default']) }}"
  loop_control:
    loop_var: ansible_aws_server_subtype

# Find all the currently running instances
- name: Get info about all the currently running instances
  include: ansible_aws_get_instances.yml
  when: ansible_aws_get_info
  vars:
    ansible_aws_state: running
  with_items: "{{ ansible_aws_server_types | default([]) }}"
  loop_control:
    loop_var: ansible_aws_server_type

# Push repos to ECR
- name: Push repos to ECR
  include: ansible_aws_push_to_ecr.yml
  when: ansible_aws_push_to_ecr
  vars:
    ansible_aws_state: running
Move from single invocation to lists * get_info * load_config
Move from single invocation to lists
   * get_info
   * load_config
