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

I was about to make the point about Ansible but I guess you've already made it in the README.


Is Ansible really too much though, as the author suggests in README for simple tasks? If all you want is basic "SSH to a server, install some packages" type behavior, I'd still make the argument Ansible is simpler than this. Ansible isn't like Chef/other competitors where you have to bootstrap or install a client on the target machine. IIRC it only really needs SSH access and a Python installation present on the target machine, which is basically most Linux distros.

Looking at how you use this thing, I'm really not sure it would save me any time versus using Ansible.


Author here. It's just a matter of personal preference. If you're proficient with Ansible then I'm sure you can achieve the same task even quicker. But to me, shell scripts are a more natural & faster way to get going for single-server setups and I always have a hard time with Ansible yaml syntax.

Ansible has some undisputed advantages (e.g. idempotence) and if I had to recommend Ansible vs my approach, I'd always recommend Ansible. But for my personal needs (single-server rails apps), I prefer shell scripts.


There's also a learning curve case to be made against Ansible: if you've spent years polishing your Bash and coreutils one liners, you start over at zero when switching to Ansible.

Ansible is also declarative (in principle) while shell scripts are imperative, which is a bit of mind bender. Then, when you debug, you have to understand that Ansible is implemented by imperative code.


The same could be said for some NIH tool.

Bringing people up to speed on in-house tools can be a major hassle. Never mind the fact that popular tools like Ansible are battle-tested and most likely has more documentations and tutorials.


the link here was for a tool using just SSH and Bash..?


For small deployments, this kind of thing means One Less Thing To Understand. I like and use Ansible, but there is a mild learning curve and the occasional gotcha.

Given you generally have to know what you're trying to achieve in shell anyway, the shell versions are simpler, if less robust. For example,

    sudo apt update && sudo apt install nginx
is easier than

    become: True
    tasks:
    - name: install nginx for great justice
      apt:
        name: nginx
        update_cache: yes
        state: latest
There are also some edge cases where shell is better than ansible; some parameters are missing from some modules, meaning shell is more flexible; or if you want to read a command's STDOUT, it's a pain in Ansible.


> IIRC it only really needs SSH access and a Python installation present on the target machine

Which for my FreeBSD machines I have to run some bootstrap code that installs Python on it before I can run ansible against it.

Would be nice if salt-ssh or ansible allowed me to have some bootstrap code that ran if Python didn't exist on the target machine.





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

Search: