Im trying to do an auto scaling group in AWS

Below is my script.

It runs and almost completes (it sets up lb, asg and lc in AWS) but times 
out with

"msg: Waited too long for new instances to become viable. Mon Nov 16 
15:35:31 2015"

Under AWS "Activity History" on Auto Scaling Group i get

"Launching a new EC2 instance. Status Reason: The parameter SecurityGroup 
is not recognized. Launching EC2 instance failed."

I have tried looking for that message with only 2 hits in all of google so 
its not a common error. 

Anything im doing wrong in the below or any idea about the message?

Thanks


---
 - name: sets up site on a vm on aws
   hosts: localhost
   connection: local
   gather_facts: false
   roles:
    - common
    - awskeys
    - awsvars
   vars:
    machine_type: t2.medium
    site_prefix: pca
    server_min_size: 1
    server_max_size: 2
    server_desired_size: 1
    aws_site_security_groups: ['http/https', 'ssh' , 'smtp']
    aws_elb_security_groups: ['http/https']
   tasks:
   - debug: var="{{ aws_region }}"
   - name: create elastic load balancer
     local_action:
       module: ec2_elb_lb
       name: "{{ site_prefix }}-elb"
       state: present
       security_group_ids: 'sg-577f9933' #http/s
       region: "{{ aws_region }}"
       zones:
         - "{{ aws_region }}a"
       listeners:
        - protocol: http
          load_balancer_port: 80
          instance_port: 80
       health_check:
          ping_protocol: http # options are http, https, ssl, tcp
          ping_port: 80
          ping_path: "/" # not required for tcp or ssl
          response_timeout: 5 # seconds
          interval: 30 # seconds
          unhealthy_threshold: 2
          healthy_threshold: 10

   - name: create launch config
     ec2_lc:
       name: "{{ site_prefix }}-lc"
       image_id: "{{ aws_vm_image }}"
       region: "{{ aws_region }}"
       security_groups: ['http/https']
       instance_type: "{{ machine_type }}"
       key_name: BOB
       assign_public_ip: yes

   - name: create auto scaling group
     ec2_asg:
       name: "{{ site_prefix }}-asg"
       launch_config_name: "{{ site_prefix }}-lc"
       health_check_period: 60
       health_check_type: ELB
       replace_all_instances: yes
       min_size: "{{ server_min_size }}"
       max_size: "{{ server_max_size }}"
       desired_capacity: "{{ server_desired_size }}"
       region: "{{ aws_region }}"
       load_balancers: "{{ site_prefix }}-elb"
#needed if public ip is required
       vpc_zone_identifier:
         - 'subnet-1448e94d'



-- 


This message is private and confidential and for the exclusive use of the 
intended recipient(s). If you receive this email in error, please notify 
the sender immediately and delete all copies from your system. If you are 
not the intended recipient disclosure, distribution, copying or use of this 
communication is strictly prohibited. Any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of IDG UK. Clients and suppliers can view our full terms and 
conditions at www.idg.co.uk/terms-and-conditions/


IDG Communications Ltd. Company Reg No: 1197840. Registered in England and 
Wales.

-- 
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/31e135c4-de1f-4226-b9c7-54519c4d89a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to