Хозяйке на заметку

If you creating Application LB from ansible to AWS and it stuck with error : 

botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the CreateAutoScalingGroup operation: Provided Target Groups may not be valid. Please ensure they exist and try again

Then need to use instead of load_balancers names : target groups 

Need to add this line :  target_group_arns: [tg.target_group_arn]

in which tg- this is register of : elb_target_group and it has to be a list

In additional vpc identifier has be added : 

   vpc_zone_identifier: [vpc_subnet_id]

and at last- it is better for AWS to enlarge timeout to 500 if you creating all together — elb_target_group, elb_application_lb, ec2_lc and ec2_asg

p.s. -livejournal removes jinja2  :) so I just typed it above as a list

- name: ASG create


    name: xxx-ASG-{{env}}

    launch_config_name: xxx-lc-{{env}}

    default_cooldown: 300

    health_check_period: 60

    health_check_type: ELB

    replace_all_instances: yes

    min_size: 1

    max_size: 1

    desired_capacity: 1

    target_group_arns: ["{{tg.target_group_arn}}"]

    vpc_zone_identifier: ["{{vpc_subnet_id}}"]

    region: "{{region}}"


        - Name: "xxx-elb-{{env}}"

    termination_policies: OldestInstance

    wait_for_instances: yes

    wait_timeout: 500

    state: present


default userpic

Your reply will be screened

When you submit the form an invisible reCAPTCHA check will be performed.
You must follow the Privacy Policy and Google Terms of use.