8 ms·
Ansible 2.13
- tryauuum 4y agoI hate ansible so much it's unreal It's the small things. Why do I have to write more than one task and register intermediate variables if I want to execute a command and see its output?
- mdaniel 4y agoIs there a competing config-management tool that behaves more like you want? I'm just curious because I haven't used the others in anger enough to know how they solve the problem you described
- tryauuum 4y agoI am a fan of SaltStack. With SaltStack approach, you don't have to write additional yaml to see the output of external command's execution. You see / don't see the output of commands based on logging settings in your client (salt-call). # EDIT: people pointed out that running ansible with additional -v's will indeed print commands. I don't understand how'd I missed that... I've certainly run ansible with -v a lot. And my favorite part of SaltStack is that you can use jinja in any place of your states
- notabee 4y agoYou can use jinja expressions inline with your Ansible tasks' yaml if you want to as well. As for whether that's a good idea or a mess to read is in the eye of the beholder. Personally I do it only as a last resort, but it has been nice to have occasionally rather than some clunky multiple-task alternative.
- tryauuum 4y agoIt's not the same, you cannot put a jinja condition in an arbitrary place of your ansible yaml, even at the middle of any line (though it's indeed a questionable approach)
- opk 4y agoIf you need to see the output of commands and tasks in ansible, select a different output callback. Where I want something rudimentary, I use `ANSIBLE_STDOUT_CALLBACK=json` and a tool like github.com/okapia/ansible-json-monitor to parse the json.
- INTPenis 4y agoSo run ansible -m command instead.
- omniglottal 4y agoExecuting a task while collecting its output is a different operation than a task to display arbitrary output generated by a command's output. Imagine two shell commands: # foo=$(cat bar) # echo $foo Yes, it's the little things we need to understand, else we'll be confused by false enumeration. Ansible excells at ensuring one (idempotent) task is indeed just one task. Try the '-v' flag for the verbosity you're looking for from one task, as it's intentionally hidden from the default output.
- tryauuum 4y agoI don't understand the first part of your comment, why do you compare different commands. My complaint is that ansible runs external command, always internally collects it output, but doesn't display it. Thank you for the "-v". I've run ansible with various amounts of -v in the past but I didn't notice that it does display stdout_lines with it!
- tryauuum 4y agoAnother part of ansible that I hate is that it encourages bad development practices. Anyone can write a working playbook and put it in some git repo. If you are not actively fighting against it, you might end up with several git repos, hundreds of playbooks and no way to easy understand what code applies to what servers. Configuration management solutions that feature agent on managed machines and don't do everything over SSH encourage people to organize their efforts in one repo. Because you cannot manually apply your config to server without pushing it to git.
- marenkay 4y agoThis I disagree with a lot. Ansible does have a lot of unfinished playbooks out there or half baked ones. But there is solid documentation there which makes it pretty clear how to properly design things. Have a feeling people just don't read it. For work related use cases, I find it very unlikely you would ever pull in a git repo or playbook from galaxy. Coming from Puppet, Chef I always thought Puppet was in a bad state but then I realized it is 2022 and Ansible has exactly zero roles for LDAP that work, or even resemble a thing that would ever make sense to run in a real installation. Also, if we're talking about what code would run on which server, I do not see where other configuration management tools would perform better. Have you seen the humongous mess one needs to do in Puppet and Hiera when one wants to build a configuration that is multi-os and multi-arch (like just a simple Debian/Ubuntu plus x86_64/aarch scenario not even Windows)? Or even what it would be like if one also manages firmware blobs there? If I may be so frank... configuration management is a shit show on every available solution. And I am saying that as someone actively being a part of these ecosystems and contributing.
- allarm 4y agoIs there any sane reason why in all standard modules the keyword “src” has 3 letters but “dest” has 4 letters instead of “dst”, which is pretty standard everywhere? Drives me crazy every time.
- zufallsheld 4y agoIf it drives you crazy, why not make a pr to add an alias for dst? For the copy module this line (and the docs) need to be changed: https://github.com/ansible/ansible/blob/cb448097e4ef581a474903947d4ec0bd358467d8/lib/ansible/modules/file.py#L909 https://github.com/ansible/ansible/blob/cb448097e4ef581a4749...
- allarm 4y agoAliases are not backward compatible, it’s not an elegant solution. It should have been properly named from the start.
- p4l4g4 4y agoI know the feeling. We use ansible extensively in our company. While it is probably the best tool at the moment to get the job done, it is not a pleasant tool for larger/complex setups. Like you said, it's the small things. The thing that annoys me most are probably variable scoping and precedence rules. Scoping is practically non-existent; a variable declared in one role can be freely accessed in another, which can easily lead to clashes when your variable names are too generic.
- gtirloni 4y ago> it is not a pleasant tool for larger/complex setups. I'd say it still is. People forget you can code your own modules in whatever language you want and just expose a nice declarative interface through Ansible.
- deleted 4y ago[deleted]
- mdaniel 4y agoI hate that I have to say this, but be aware that one cannot "pip install ansible==2.13" (https://pypi.org/project/ansible/#history https://pypi.org/project/ansible/#history) since they took over the "ansible" name to mean the "ansible distribution", which includes the project you linked to as well as a bazillion separately versioned galaxy dependencies For example, "ansible 5.7.1" is actually this: https://github.com/ansible-community/ansible-build-data/blob/5.7.1/5/ansible-5.7.1.deps https://github.com/ansible-community/ansible-build-data/blob... which includes "ansible" 2.12.5 It makes even talking about it hard
- tehbeard 4y agoSo they did the work to split modules out of "core" for ease of development, and then completely mangled the versioning?
- mdaniel 4y agoI believe it's likely just a nomenclature problem; had they left "ansible" pointing at GH/ansible/ansible and called the new thing "superansible" (or whatever) it would have been so much easier to reason about and wouldn't have needed a damn near secret side-repo named "ansible-build-data" in which they would hide the actual, no kidding, git tags The first time someone had to create a GH release named "these are not the releases you're looking for" would have been a great opportunity to acknowledge how off the rails things had gone: https://github.com/ansible/ansible/releases/tag/v2.2.1.0-0.3.rc3 https://github.com/ansible/ansible/releases/tag/v2.2.1.0-0.3... Related to that, I consider it almost purposefully misleading of them to leave the PyPI "source" link pointed at GH/ansible/ansible since that is _for sure_ not what is going to be pip installed for those version numbers. It'd be like pointing the ansible PyPI at the Jinja2 GH repo -- yes, that is one of the things that pip installing will put on disk, but where did the rest of it come from?
- rollcat 4y agoI hope you don't mind me stealing your comment to plug my side project, Judo. It was created in 2016, out of my frustration with Ansible. Judging by the state of affairs, that motivation continues to be relevant. https://github.com/rollcat/judo https://github.com/rollcat/judo
- corrral 4y agoIs there a reasonable refuge for people who are: 1) Sick of YAML-as-a-scripting-language 2) Not on the k8s train yet 3) Fans of operational simplicity, like Ansible's (no persistent agent required on the other end, just operates over ordinary SSH, that kind of thing) ?
- rr808 4y agoOld School simple bash script ( < 10 lines). tar.gz files with your whole distribution. extract to a directory with a version on it then rely on a softlink that chooses which version to use.
- anotherhue 4y agoNixos has some of these benefits. You can do a lot with systemd and containers.
- blueflow 4y agoWe are currently evaluating nix as an replacement for our internal build system, our main product is some kind of linux distro. Nix has real bad onboarding and documentation, the creators hopped off to some other, shinier side projects (flakes) and the rest of the community is struggling to manage the immense maintenance cost of keeping the packages up-to-date and integrated. And the external consultants we hired for it are like, hardcore believers that always tell you how great nix will be in the future, but completely disregard our needs like building offline in a separated network. Which is officially supported but unusable to due bugs. My bet is that $boss will cancel it this year.
- VTimofeenko 4y agoDisclosure: I love Nix ecosystem, but I acknowledge the fact that it's perfect for my use cases which are very different from those of a business. > Nix has real bad onboarding and documentation Could not agree more. I found that diving into it head first actually did yield good results in the end but it was really not quick. > some other, shinier side projects (flakes) I would argue that flakes are an absolute necessity and logical continuation of the ecosystem development rather than a side project. Flakes allow to truly describe the desired state of the system from one place and properly pin all objects to their places.
- snird 4y agoI love Ansible. I recently re-wrote the infrastructure setup of a startup. They had a Chef infra-as-code before, written for CentOS 7. Since CentOS is dead, and I took the opportunity to move to Debian, it wasn't worth it to keep working with Chef so I re-wrote in Ansible. And it was fantastic. Maybe because Chef is so awful and convoluted my reference point is skewed. But I loved every moment. It was simple, the documentation is great, the extended packaged are great (I set up an highly available redis sentinel infra with one ansible-galaxy import and ~20 lines playbook). Yeah, Kubernetes and Docker are the cool kids. But Ansible is killing it if you still live in a world of VMs.
- rr808 4y agoThe only thing I use Ansible for is to parallelize running the same script on a bunch of servers. Would be nice to have a simpler app to do this.