4 ms·
Ansible has way too few examples and documentation going around it. The supplied examples are way too simplistic and do not mirror any real life application at
by sandGorgon 13y ago
Ansible has way too few examples and documentation going around it. The supplied examples are way too simplistic and do not mirror any real life application at all.
I really hope that the authors create a non trivial project (like hadoop on EC2) which exercises a lot of parts of Ansible, document it throughly and structure it to match real life workflows. It's really, really hard to go around hunting for documentation.
For example, I did not even know after reading the Ansible-EC2 documentation for a few hours that you need to periodically run "python ec2.py" to keep refreshing your inventory in a cache on your disk. I somehow thought (or intuitively expected) all that happened in the background on running the playbook, and just take a few minutes longer - it's not as if any time is saved, since you have to run the inventory script anyway.
Single playbooks that launch an EC2 instance, print hello and shut it down are not the typical use case.
- jamtan 13y agoWe do have some fairly complex / real world examples within our ansible-examples repository. A hadoop cluster for instance ... https://github.com/ansible/ansible-examples/tree/master/hadoop https://github.com/ansible/ansible-examples/tree/master/hado... For a complex EC2 example, here's an openshift deployment ... https://github.com/ansible/ansible-examples/tree/master/openshift https://github.com/ansible/ansible-examples/tree/master/open...
- sandGorgon 13y agowell yes, but it is hard to learn from it. For comparison take a look at this - https://gist.github.com/marktheunissen/2979474 https://gist.github.com/marktheunissen/2979474 [pedantically_commented_playbook.yml]. NOTE: yes, I did note mpdehaan's comments that this yml is old. However being a beginner in Ansible, I learned a LOT from this. The OpenShift example is a bit funny - I had asked this on the forums as well. For example the play to shut down a running cluster first attempts to idempotently launch it, causing the appropriate variables to set and then uses it to shut it down. There is another way to do it without doing this. Again, I'm not advocating approach A vs B - I just dont know which is The Right Way and why. As I said, it is really really hard to learn non-trivial workflows in Ansible. I'm still plowing ahead, but I strongly suspect that is because Ansible has been getting all this support in HN and it is right now the flavor of the month.
- mpdehaan2 13y agoYeah, I don't think everyone shares that opinion, but I do agree we need a better index and a few more examples. We're always working to improve examples however, and one of the things we're going to be adding is a lot of vertical guides that show some (especially provisioning) workflows from start to finish. One of the things that is really going to help is the launch of Galaxy in the next few weeks, which is a web site for everybody to share roles, so you will have tons of easy ways to find bonus examples. Thanks for feedback!