Live data from Hacker News

Show HN: Welder – set up your Linux server with plain shell scripts

github.com

41–50 of 71 posts

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#41

Earlier quoted context omitted.

Stupid question, but why are Ansible playbooks supposed to be "more idempotent" than plain shell scripts? Due to taking over a project I had to deep dive into it pretty quickly and to me it feels like shell in yaml syntax.

You might be on the same idempotency level with very disciplined shell scripts, but you won't have reporting out of the box. If I deploy something with ansible, I can see which changes were applied. This way, I can see whether I just changed something I didn't want to change. Other than that, yes, much discipline makes the difference. I know exactly what a core module does, but I have to read the entire shell script…

> This way, I can see whether I just changed something I didn't want to change.

Or with --check, before you make the change :)

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#42
post #3

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 targ…

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.

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#43

I used to bootstrap a lot of VMs in development using shell scripts [1]. At a certain point Bash scripts become unmanageable. Ansible, Chef, Puppet have stricter syntax, battle-tested modules, large communities, proper multi-OS support, etc. Investing time to learn any of those tools certainly pays off in the long run. Bash is great for a quick setup or a one-off instance. However it requires discipline for anything…

so it is the scripting language used by ansible, chef, puppet that imposes the required "discipline"?

methinks each of these must in fact call the shell to get things done or least system(3).

if they are calling execve then i would be more interested.

i would also be interested in ansible, chef, puppet if i knew the scripting languages they are written in or wanted to learn them. but other languages interest me more.

as a hobbyist, what i would like to see is a hosting provider that will boot fs images (including bootloader) that user builds on users own computer. i.e., provider gives exact specs of machine and network details. user builds and sends fs image to provider and provider boots from it on some bare metal in a datacenter.

no "host" or "guest". no virtual server. no provider software. if something software-related does not work, it is user's responsibility because it is all user's software. user can send an updated fs image.

anyone know if this exists? the service wanted is barebones: a computer in a datacenter that has an internet connection and someone to boot it from user fs image. cost not an issue.

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#44
post #43

I used to bootstrap a lot of VMs in development using shell scripts [1]. At a certain point Bash scripts become unmanageable. Ansible, Chef, Puppet have stricter syntax, battle-tested modules, large communities, proper multi-OS support, etc. Investing time to learn any of those tools certainly pays off in the long run. Bash is great for a quick setup or a one-off instance. However it requires discipline for anything…

so it is the scripting language used by ansible, chef, puppet that imposes the required "discipline"? methinks each of these must in fact call the shell to get things done or least system(3). if they are calling execve then i would be more interested. i would also be interested in ansible, chef, puppet if i knew the scripting languages they are written in or wanted to learn them. but other languages interest me more.…

Used to do this working at a colo back in the 90s; boot the image then walk away. If someone borked their machine they'd email or call and we'd roll the power for them.

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#46
post #43

I used to bootstrap a lot of VMs in development using shell scripts [1]. At a certain point Bash scripts become unmanageable. Ansible, Chef, Puppet have stricter syntax, battle-tested modules, large communities, proper multi-OS support, etc. Investing time to learn any of those tools certainly pays off in the long run. Bash is great for a quick setup or a one-off instance. However it requires discipline for anything…

so it is the scripting language used by ansible, chef, puppet that imposes the required "discipline"? methinks each of these must in fact call the shell to get things done or least system(3). if they are calling execve then i would be more interested. i would also be interested in ansible, chef, puppet if i knew the scripting languages they are written in or wanted to learn them. but other languages interest me more.…

> as a hobbyist, what i would like to see is a hosting provider that will boot fs images (including bootloader) that user builds on users own computer. i.e., provider gives exact specs of machine and network details. user builds and sends fs image to provider and provider boots from it on some bare metal in a datacenter.

This is actually somewhat possible with linode. It's not easy to do but it's possible.

https://www.linode.com/docs/platform/disk-images/migrating-a...

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#48
On the subject of non-approved sysadmin/devops tools,

I wrote a little 'tarball compiler' framework in mostly PMake some time ago to "DevOps" like it's 19[89]9 ... basically it will build per-host file overlay trees, rdist them out to target hosts, and then optionally run user defined start/stop/restart hook scripts when needed.

https://github.com/ixcat/admmk/blob/master/doc/admmk.rst

unfortunately, though it will do per-host targets, I didn't get around to per-service targets.. should be feasable however.

Definitely a bit hairy, but hey, thats what quasi-functional symbolic makefile programming is all about my friends..

ps: if you think this is bad, try rewriting it in gnumake if that's even possible.. PMake! Woo!

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#49
There is really not much you can't do using HashiCorp's Packer[1] and Terraform[2].

Packer can generate base images and roles based on shell scripts and transferring files. Terraform manages the creation of infrastructure on clouds and can bootstrap instances with shell scripts as well.

[1] - https://terraform.io [2] - https://packer.io

Re: Show HN: Welder – set up your Linux server with plain shell scripts

#50
post #38

Earlier quoted context omitted.

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..?
Post reply on HN