Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love the concept, but I couldn't figure out how to make the server inventory dynamic. I tag a lot of instances and want to use the AWS API to grab a list of tagged instances to automatically build the server inventory on execution.

Since the instances are so variable (auto-scaling etc.) I see that as a killer feature. Maybe I have to dig deeper, but I spent some time evaluating it against Chef/Puppet etc. and I couldn't find anything.



Don't call it "server manifest". It'll confuse people. You mean "inventory". You can dynamically populate "facts" and "inventory". See:

https://github.com/ansible-provisioning/ansible-provisioning

http://jpmens.net/2013/06/18/adapting-inventory-for-ansible/

Especially for ec2 there is many modules that allows you to do that too. You can easily specify an inventory file which you populates dynamically.

There is also a lot being done about this in v1.3.

HTH


Yeah check out the API chapter of the docs, there's information about all kinds of dynamic inventory scripts.

https://github.com/ansible/ansible/tree/devel/plugins/invent...


Excellent! Thanks for letting me know. I'll have to dive back in and check it out.


This is exactly the info I needed for some work I am doing. Thanks!


not sure how long ago you tried it out, but ansible has an ec2 inventory script bundled along with it, that you can use instead of maintaining static manifests. This script plugs into the AWS API to get you a list of instances and metadata. Along with that, comes all the goodness of tags and pattern matching, so you can do stuff like tag_Name_DB*:&tag_type_slave to select all database slaves (if you had tags called "Name" and "type" for example)


That's awesome. I just spent some time going through the getting started section for each project so in my haste I missed all the best parts. Back to it!


The folks at the google group or IRC channel are super helpful. Ask there and you will usually get an answer fairly quick.


If server manifest is executable, it executes the script rather than reading it.


Seems silly in hindsight to not consider that. ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: