TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Replacing Ansible with salt-ssh

95 pointsby spycover 4 years ago

14 comments

richardfeyover 4 years ago
I went the other way around instead, from salt(-ssh) to Ansible. I could not bear the slow speed though, so I suggest everyone who hasn&#x27;t tried yet to use it with Mitogen. I don&#x27;t think I will ever go back and in fact I expect upstream to eventually adopt it.<p>Major issues with Salt: lots and lots of bugs and quirks. I have had my fair share of those in Ansible over the years as well, but Salt is just not good enough for my taste. A strong NIH is perceived all over its design.
评论 #24862709 未加载
评论 #24864654 未加载
评论 #24863357 未加载
folkenover 4 years ago
What people don&#x27;t get about salt, is that its literally kubernetes (as in orchestrator) for your infrastructure.<p>It takes the &quot;operator&quot; concept to a very new level: You can tell it to react automatically and enlarge a disk in a machine due to space constrains, reschedule workloads according to load, configure a loadbalacner according to rules you write once, create resiliency rules, deploy new machines or containers...<p>It scales ridiculously, i have seen 30000 minions to a master.<p>Why you would use it via ssh other than bootstrapping is beyond me...<p>btw: you can run ansible via the salt bus transport = salstack in the ansible.cfg, be amazed.
评论 #24863908 未加载
Spivakover 4 years ago
This seems like a <i>lot</i> of work for such a small problem in Ansible that can actually be fixed without any patches. Here&#x27;s an example.<p><pre><code> - name: Pretend to install stuff. debug: var=item with_items: [git, httpd, vim] when: - &quot;&#x27;all&#x27; in ansible_run_tags or item in ansible_run_tags&quot; - item not in ansible_skip_tags tags: always </code></pre> If you run without any tags it will install everything and if you specify --tags=git it will only install git and if you specify --skip-tags=vim it will do the correct thing.<p>Ref: <a href="https:&#x2F;&#x2F;docs.ansible.com&#x2F;ansible&#x2F;latest&#x2F;reference_appendices&#x2F;special_variables.html" rel="nofollow">https:&#x2F;&#x2F;docs.ansible.com&#x2F;ansible&#x2F;latest&#x2F;reference_appendices...</a><p>And in the specific case of installing packages you can speed this process up dramatically with something like the following without having to use tags.<p><pre><code> - name: Probe the host for installed packages. package_facts: - name: Install packages. package: name={{ item }} with_items: [git, httpd, vim] when: item not in ansible_facts.packages </code></pre> But this itself is really inefficient too because you&#x27;re still calling the module for every package instead of calling the module once with all the packages. Older versions of Ansible did this automatically but it was super magic so it&#x27;s probably better that it was removed. We can do it ourselves though.<p><pre><code> - name: Install packages. package: name={{ to_install }} vars: packages: [git, httpd, vim] to_install: &quot;{{ packages | difference(ansible_facts.packages) | list }}&quot;</code></pre>
评论 #24861283 未加载
评论 #24863320 未加载
athenotover 4 years ago
The author&#x27;s example of using loop data out of loops is overlooking anchors and aliases in YAML. His example can be rewritten as:<p><pre><code> - hosts: all tasks: - name: Install distro packages package: name: &quot;{{ item }}&quot; state: present with_list: &amp;packages - git - htop tags: *packages</code></pre>
评论 #24863591 未加载
tutfbhufover 4 years ago
Isn&#x27;t it possible to create many small playbooks, instead of a big one. This would allow you to just run the stuff you need. And if you need all e.g. for bootstraping then you can create one playbook that simply includes the smaller ones with the import_playbook statement. This also gives you the flexibility to create other subsets based on your needs.
评论 #24863573 未加载
评论 #24866139 未加载
评论 #24863672 未加载
xet7over 4 years ago
Regarding VMware buying SaltStack, it is a good thing, Tom will have more time to code, according to TheHacks podcast episode about it at <a href="https:&#x2F;&#x2F;www.saltstack.com&#x2F;the-hacks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.saltstack.com&#x2F;the-hacks&#x2F;</a> that I usually listen from page <a href="https:&#x2F;&#x2F;thehacks.libsyn.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thehacks.libsyn.com&#x2F;</a> .<p>From other podcast episodes I got to know that they at SaltStack are currently merging those many differently maintained SaltStack repos together to less repos, so it will make progress faster.<p>Disclaimer: I do not work at SaltStack. I just happily listen to their podcasts and I have used SaltStack for managing my servers.
crmrc114over 4 years ago
You lost me when you when the author failed to properly understand how to use {{ item }} by defining with_items:<p><a href="https:&#x2F;&#x2F;www.educba.com&#x2F;ansible-with_items&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.educba.com&#x2F;ansible-with_items&#x2F;</a><p>Let me fix his code here: <a href="https:&#x2F;&#x2F;pastebin.com&#x2F;PQDAnHiJ" rel="nofollow">https:&#x2F;&#x2F;pastebin.com&#x2F;PQDAnHiJ</a><p>I use with_items at least once a day in this manner.
评论 #24860112 未加载
评论 #24863264 未加载
评论 #24861034 未加载
fanf2over 4 years ago
The main reasons I started using Ansible in 2013 were its agentless setup (which this article covers nicely) and its --check --diff options (which this article leaves out). Does salt have a do-nothing sanity check mode?
评论 #24861527 未加载
评论 #24861634 未加载
bovermyerover 4 years ago
As it happens, I moved from Ansible to Chef not too long ago as my provisioner of choice.<p>It can be used with just SSH and Chef Zero (no need for a Chef Server), and it&#x27;s built with Ruby and Chef&#x27;s DSL and not YAML.<p>It took me several years to not hate Chef&#x27;s approach, though, compared to the ease of use of Ansible.
评论 #24863036 未加载
评论 #24863926 未加载
aprdmover 4 years ago
Hm as others mentioned it is possible to use Ansible in a very &quot;usual&quot; way to solve this problem.<p>I would love if we standardize in Packer, Ansible and Terraform. Luckily it seems like the devops world is standardizing in this stack ... there&#x27;s very little you can&#x27;t do in an elegant way using those 3 tools (only use the 3 if you need, a lot of shops only use Ansible for example)
评论 #24861427 未加载
评论 #24864474 未加载
评论 #24876705 未加载
aloerover 4 years ago
Slightly OT:<p>I have recently done some scripting work on a single machine and used Ansible because it makes it so convenient to parse output, generate config files etc., mostly shell and jinja2<p>Is that valid use of Ansible or should I be ashamed and use something else?
评论 #24862463 未加载
评论 #24862532 未加载
评论 #24862401 未加载
hibbeligover 4 years ago
I fondly remember CFengine. Though it did require installation on the host to be managed, but that seemed rather simple: Log in, install CFengine and git, clone the repo, and off you go to run it.
评论 #24882978 未加载
beefbroccoliover 4 years ago
I revisit these tools every so often and I still don&#x27;t understand how they&#x27;re any better than simple shell scripts.
评论 #24865140 未加载
elkteaover 4 years ago
I like the look of the file.keyvalue. Anything like that in ansible? <a href="https:&#x2F;&#x2F;docs.saltstack.com&#x2F;en&#x2F;latest&#x2F;ref&#x2F;states&#x2F;all&#x2F;salt.states.file.html" rel="nofollow">https:&#x2F;&#x2F;docs.saltstack.com&#x2F;en&#x2F;latest&#x2F;ref&#x2F;states&#x2F;all&#x2F;salt.sta...</a>