ansible / autoscaling-blog

Companion playbooks to an article at http://www.ansible.com/blog/autoscaling-infrastructures
55 stars 46 forks source link

Callback isn't working #3

Closed einarc closed 8 years ago

einarc commented 8 years ago

I made sure all the configurations were ok and that the My Inventory had some hosts in it, I even scheduled to update every 5 min and still the /tmp/autoscale.log file in the actual instances reports a 400, no hosts found. Even when I do it manually.

`curl -k -s -i --data host_config_key=My-key_here https://FQDN/api/v1/job_templates/759/callback/ HTTP/1.1 400 BAD REQUEST Date: Tue, 03 May 2016 03:01:03 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Vary: Accept,Cookie Allow: GET, POST, HEAD, OPTIONS X-API-Time: 0.042s Content-Length: 43 Connection: close Content-Type: application/json

{"msg": "No matching host could be found!"}`

einarc commented 8 years ago

I figured out that I've set my launch config and subnet to be public (which is unnecessary) so when I changed this: vpc_destination_variable: ip_address

I started getting: /tmp$ curl -k -s -i --data host_config_key=my_key https://my_server/api/v1/job_templates/759/callback/ HTTP/1.1 202 ACCEPTED Date: Tue, 03 May 2016 03:10:27 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Vary: Accept,Cookie Allow: GET, POST, HEAD, OPTIONS X-API-Time: 0.264s Location: https://my_server/api/v1/jobs/52/ Content-Length: 0

Source: https://github.com/ansible/ansible/blob/devel/contrib/inventory/ec2.ini