5 ms·
Yes. - you use an actual programming language (which you're likely to already know) instead of desperately figuring out how to simulate a for loop in yaml or t
by karlicoss 4y ago
Yes.
- you use an actual programming language (which you're likely to already know) instead of desperately figuring out how to simulate a for loop in yaml or to replace a part of a string, or whatnot
- you have all Python static analysis tools at your disposal. mypy/pylint etc can make your deploys less error prone
- you can easily implement a custom DSL in python, so deploys ends up more declarative and with less copy pasting
- it's easy to implement custom arbitrary operations (since you're working in python) -- and again you can reuse variables, etc instead of having to use some weird templating or pass them in command line
- blondin 4y agoso pulumi[1]? [1]: https://github.com/pulumi/pulumi https://github.com/pulumi/pulumi
- latchkey 4y agoAs much as I want to love pulumi, their ssh story seems missing. It feels like pulumi is dedicated towards managing cloud instances through cloud apis, while I'd want to manage bare metal instances through ssh (or a local daemon). I'd love correction on this.
- pbecotte 4y agono, you're right. Terraform/Pulumi are much more focused on provisioning resources, while Ansible has its sweet spot in configuring a machine once its running.
- usrme 4y agoAt what point are you just re-inventing what Ansible already does if you're going down the DSL path? I sometimes feel like I'm in the minority, but I truly do like Ansible and if you slap Mitogen[1] in front of it makes the whole process even more enjoyable! I'm honestly trying to understand whether this hating on Ansible is more of a bandwagon thing (similar to how people shit on the Python dependency management ecosystem) and stems from having bad experiences that have completely turned them off of it. Honest questions in response to your points: 1. What are you deploying where you would need static analysis? 2. If you did end up writing your own DSL on top of Python at what point would you concede that it's probably better to use someone's else creation as opposed to forever iterating on your own thing for the sake of using your own thing? 3. Why would you want "custom arbitrary operations" and how custom are they that Ansible and Jinja2 can't do that for you in usage patterns that are far more common than your own creation would be? --- [1]: https://mitogen.networkgenomics.com/ansible_detailed.html https://mitogen.networkgenomics.com/ansible_detailed.html
- mdeeks 4y agoDoes mitogen really only support up to Ansible 2.9? Thats a couple years old isn't it? I was really excited for it until I saw that :(
- PaywallBuster 4y agoHave releases up to 2.13 https://github.com/willhallonline/docker-ansible https://github.com/willhallonline/docker-ansible Still multiple major releases behind but still Also I wonder how often the new releases are used (market share?) since so many people moved to cloud/k8s
- usrme 4y agoI'm on 'ansible==5.5.0' / 'ansible-core==2.12.3' and am using Mitogen with no issues whatsoever.
- traverseda 4y agoOne example where I personally ran into trouble with ansible was in dealing with SSL certificates. In production we use letsencrypt to generate SSL certificates as you'd expect, but for testing we were using self-signed certificates. This was surprisingly complicated under the ansible model, basically I ended up writing a reusable playbook that worked more or less as a function, and running a hook at the end to actually create the keys. Due to the specifics of our app depending on what kind you needed the actual certificate paths got the certificates were different. So I ended up doing some crazy hacks passing around state instead of just writing a function.
- Terretta 4y agoFeels as though perhaps this should have dropped from playbook into a module? https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html https://docs.ansible.com/ansible/latest/dev_guide/developing... Then just writing a function.
- traverseda 4y ago