I am trying to create an ASG from within a playbook. Running ansible 2.2.1 from Mac OS.
Playbook below:
`
#setup Logstash Autoscaling group
- name: ELkstack LogStash ASG
ec2_asg:
name: “pro-ELK-LogStash-ASG”
launch_config_name: “test-logstash-asg”
health_check_period: 300
health_check_type: EC2
replace_all_instances: yes
replace_batch_size: 1
min_size: 1
max_size: 4
desired_capacity: 1
region: us-east-1
`
And when I run this, I get the following error. This is in a playbook that I also am setting up Security groups, elastic load balancer, launch config, tag assets, etc. All of these tasks work. I’ve moved this portion to its own test playbook, and this is the only portion of the playbook that fails.
here is the -vvv output
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File “/var/folders/08/x2n75q_925l5xc9hfjc1gz9c0000gn/T/ansible_38fX0z/ansible_module_ec2_asg.py”, line 875, in
main()
File “/var/folders/08/x2n75q_925l5xc9hfjc1gz9c0000gn/T/ansible_38fX0z/ansible_module_ec2_asg.py”, line 864, in main
create_changed, asg_properties=create_autoscaling_group(connection, module)
File “/var/folders/08/x2n75q_925l5xc9hfjc1gz9c0000gn/T/ansible_38fX0z/ansible_module_ec2_asg.py”, line 437, in create_autoscaling_group
launch_config=launch_configs[0],
IndexError: list index out of range
fatal: [localhost]: FAILED! => {
“changed”: false,
“failed”: true,
“invocation”: {
“module_name”: “ec2_asg”
},
“module_stderr”: “Traceback (most recent call last):\n File "/var/folders/08/x2n75q_925l5xc9hfjc1gz9c0000gn/T/ansible_38fX0z/ansible_module_ec2_asg.py", line 875, in \n main()\n File "/var/folders/08/x2n75q_925l5xc9hfjc1gz9c0000gn/T/ansible_38fX0z/ansible_module_ec2_asg.py", line 864, in main\n create_changed, asg_properties=create_autoscaling_group(connection, module)\n File "/var/folders/08/x2n75q_925l5xc9hfjc1gz9c0000gn/T/ansible_38fX0z/ansible_module_ec2_asg.py", line 437, in create_autoscaling_group\n launch_config=launch_configs[0],\nIndexError: list index out of range\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE”
}
Any help or ideas is appreciated…