Live data from Hacker News

Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

github.com

51–60 of 86 posts

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#51
post #3

Earlier quoted context omitted.

I'd imagine it's because it's available everywhere (even openwrt routers and those things), and it's easier to get away with not having to use sudo (depending on the task you are doing, of course). With Ansible, you almost always need python installed on the target host. Which, in 95% of cases is not a problem. It's not ideal to install a system package just because you want to do some provisioning (there are ways ar…

> it's available everywhere (even openwrt routers and those things) BASH itself? Or a Bourne-family shell? I thought most embedded systems were shipping busybox's ash as /bin/sh

It's common even for embedded systems which use busybox to provide /bin/bash because bash itself is not that large.

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#52

Earlier quoted context omitted.

Idempotency and reusability are what I like about Ansible. YAML is a dependency I could do without. Maybe what we need is a set of CLI commands that mirror Ansible modules in performing idempotent operations through SSH and APIs.

Is ansible really reusible? We had an ansible deploy for bringing up MySQL database. I stopped using the codebase and came back to it months later; and I spent two days trying to get it to work (it was an unholy combination of local and community yaml) and eventually just rewrote the damn thing as a bare sequence on literal MySQL (in 20 minutes I might add) and disabled verification - definitely worst practices - to…

Honestly, this is going to sound absolutely terrible, but the easiest way I found around some limitations of mysql modules in Ansible is to create SQL statements using a template and just load that in.

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#53

Earlier quoted context omitted.

Could you elaborate on how and why s-expression solve address the issues of yaml-based DSL? Thanks

S-expressions have keywords, and don't require commas between list elements. That alone goes a _long_ways towards making s-expression based languages way more readable/writable than a similar datastructure encoded in something like JSON or YAML. Here's an example of a JSON coded query taken from a PuppetDB tutorial (PuppetDB uses a very lispy query language): ["and", ["=", "type", "User"], ["=", "title", "nick"]] And…

why are you encapsulating everything in lists for your yaml example? you arent in your other examples either?

    - filters:
        - operant: =
          type: user
        - operant: =
          title: nick
if the module author wants to, he could even remove the secondary list because its the same operator, making this

      - filters:
        - operant: =
          type: user
          title: nick
thats just as readable as your other examples imo. yaml doesnt have to be an unreadable mess. its just possible to make bad apis, which remains true for yaml just as for any other format.

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#54
I would never trust my infrastructure management to a system of bash scripts. It's like wiring up an airplane with paper clips and hot glue.

And looking at the commit history...this doesn't look like a well managed project. Almost every commit is "fix" "fix" "fix" with errors that would have been caught in a better language.

It's probably also incompatible with the various versions of bash out there, as evidenced by the TODO:

> Bashible uses GNU/grep, GNU/sed and other programs which may not work properly on all platforms

I'm sorry, but this looks like a nightmare in the making for any team that tries to use it.

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#55

Earlier quoted context omitted.

Y'all just have bias against the string system. Writing decent code in bash is just as possible as any other language. I stick to POSIX sh but same difference.

Why POSIX sh? Bash is everywhere. I once in my career had access to and needed jobs performed on a mainframe with AIX running. It had bash, it had ruby, it had day, it had fish shell. I couldn't and can't understand why people insist on asceticism (Korn shell, POSIX sh) when nicer options are available.

Eh, I simply don't need bash.

Every few dozen scripts or so I'll change the shebang to bash to have more than 1 array, but other than that I seldom pine anything that it has to offer. I believe it's a bloated mess along with most GNU utils, so avoiding it is partially out of spite, but I wouldn't impair my code to do so.

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#56

Bash should be recognized as the tech equivalent of asbestos.

Y'all just have bias against the string system. Writing decent code in bash is just as possible as any other language. I stick to POSIX sh but same difference.

"Thirteen Incorrect Ways and Two Awkward Ways to Use Arrays"

http://www.oilshell.org/blog/2016/11/06.html

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#57

Earlier quoted context omitted.

Idempotency and reusability are what I like about Ansible. YAML is a dependency I could do without. Maybe what we need is a set of CLI commands that mirror Ansible modules in performing idempotent operations through SSH and APIs.

Is ansible really reusible? We had an ansible deploy for bringing up MySQL database. I stopped using the codebase and came back to it months later; and I spent two days trying to get it to work (it was an unholy combination of local and community yaml) and eventually just rewrote the damn thing as a bare sequence on literal MySQL (in 20 minutes I might add) and disabled verification - definitely worst practices - to…

This is fairly anecdotal, but... The Ansible Galaxy is a repository of code/libraries that people have written and published to be consumed by others. I've _never_ been able to use anything I've found on the Ansible Galaxy in my environment because everything I've looked at has been so opinionated or inflexible it would be less work to write something that does the same job from scratch.

This is in stark contrast with my experience with the Puppet Forge, which my environment uses 20+ modules from for managing different parts of our systems.

Re: Bashible: An Ansible-inspired deployment/automation tool written in Bash DSL

#60
post #12

Portability is pretty important in the deployment/automation space and it's hard to beat bash in that capacity. It just sucks that bash sucks so much.

bash 4.3 introduced a lot of changes (like addition of declare -n); there are many versions of bash, so it's not something set in stone.

https://lists.gnu.org/archive/html/info-gnu/2016-09/msg00012...

Post reply on HN