Commit 3db80e8a by Fred Smith

add hosts to edx_service created clusters

parent 21c9f09e
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
hosts: all hosts: all
connection: local connection: local
gather_facts: False gather_facts: False
vars:
state: "present"
tasks: tasks:
- name: Manage IAM Role and Profile - name: Manage IAM Role and Profile
ec2_iam_role: ec2_iam_role:
...@@ -259,10 +257,11 @@ ...@@ -259,10 +257,11 @@
instance_profile_name: "{{ instance_profile_name }}" instance_profile_name: "{{ instance_profile_name }}"
volumes: "{{ service_config.volumes }}" volumes: "{{ service_config.volumes }}"
ebs_optimized: "{{ service_config.ebs_optimized }}" ebs_optimized: "{{ service_config.ebs_optimized }}"
with_sequence: count={{ create_instances | default(created_service_subnets.results | length) }} with_sequence: count={{ (create_instances | int - potential_existing_instances.instances|length) | default(created_service_subnets.results | length) }}
when: not auto_scaling_service and potential_existing_instances.instances|length == 0 when: not auto_scaling_service and (potential_existing_instances.instances|length < create_instances | int)
register: created_instances register: created_instances
- name: Add new instances to host group - name: Add new instances to host group
add_host: add_host:
hostname: "{{ item.1.private_ip }}" hostname: "{{ item.1.private_ip }}"
...@@ -272,9 +271,8 @@ ...@@ -272,9 +271,8 @@
ansible_ssh_user: ubuntu ansible_ssh_user: ubuntu
volumes: "{{ service_config.volumes }}" volumes: "{{ service_config.volumes }}"
with_subelements: with_subelements:
- created_instances.results - created_instances.results | default({})
- instances - instances
when: not auto_scaling_service and potential_existing_instances.instances|length == 0
- name: Configure launched instances - name: Configure launched instances
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment