7 ms·
ShutIt – Automation framework for programmers
- Phithagoras 10y agocode at https://github.com/ianmiell/shutit https://github.com/ianmiell/shutit
- throwanem 10y agoFor the working sysadmin or devops specialist, what does this offer over e.g. Ansible?
- collyw 10y agoI wish this sort of question was asked a lot more often when we see something "new" on HN.
- dreamsofdragons 10y agoAnd I wish people like you kept their mouths shut. Seriously. Never ever give someone shit for creating.
- throwanem 10y agoWho, aside from you, is giving anyone shit here? I'm not saying ShutIt shouldn't exist; I'm asking what, if anything, makes learning it a worthwhile use of my time. Should the answer to that question be "nothing", it's still no judgment on ShutIt's existence; it's just a piece of information useful to people who calibrate their expenditure of attention perhaps differently from the way in which you do.
- deleted 10y ago[deleted]
- dreamsofdragons 10y agoI apologize if I misread your comment.
- throwanem 10y agoNo apology necessary; it's entirely reasonable to have read my original comment in the fashion you did. I've edited it to clarify my intent.
- collyw 10y agoWhat shit did I give anyone?
- dozzie 10y agoI wish some other question was asked more: "for configuration management, why Ansible with its atrocious YAML-encoded programming language over CFEngine or Puppet?"
- throwanem 10y agoI agree that YAML's a mess, but not requiring a client-side agent is a pretty big win in my experience, and to be honest none of the configuration management systems I've used has had a particularly comfortable specification language.
- zwischenzug 10y agoI've learned the hard way that CM is a Hard Problem. Any solution is going to be a trade-off, which is why there is space for multiple solutions.
- dozzie 10y agoOh, but Ansible does require a client-side agent. It just happens that the agent is the same one as you use for interactive purposes, which is another big no-go in the long run (when you let your servers' users configure SSH server to some extent, and then you need to make sure they don't cut out your configuration management tool). Also, configuration management tool should be, apart from downloading configuration from somewhere, independent from any external server/service.
- zwischenzug 10y agoThe linked-to page offers some examples, eg its use as a teaching tool. I'm also building on ShutIt to create a really stupid-simple automation language based on Dockerfiles: https://github.com/ianmiell/shutitfile https://github.com/ianmiell/shutitfile
- zwischenzug 10y agoHere's some videos of its use as a teaching tool: https://zwischenzugs.wordpress.com/2016/04/24/interactive-git-tutorials-rebase-and-bisect/ https://zwischenzugs.wordpress.com/2016/04/24/interactive-gi... If people have a use for this for their org I'd be happy to help them write more.
- leetrout 10y agoThere's also a somewhat similar tool (much more bare bones) called fabric. http://www.fabfile.org/ http://www.fabfile.org/ I've used Fabric a lot and it's "cousin" invoke. I wish I'd seen fabric listed in the requirements.txt because I feel like it's got a nice API and has been around a while and is probably a bit more battle tested...
- zwischenzug 10y agoThat is quite similar. Looks like it's a bit less general-purpose than ShutIt though.
- gingerlime 10y agoAs a fabric user, I'm curious what makes it less general-purpose than ShutIt ? (or trying to understand the differences between them)
- zwischenzug 10y agoLooks ssh-based - ShutIt can be applied to various delivery methods (there are 4 at the moment - bash, ssh, docker and dockerfiles).
- zwischenzug 10y agoAuthor here. Quite surprised to see this. Another related tool I'm working on is: https://github.com/ianmiell/shutitfile https://github.com/ianmiell/shutitfile Why this over Ansible? It's a long story :) Mainly because not everyone is a great or even decent programmer, so I wanted an easy way in for them for the situation I was in. Hence automation for everyone. But I don't think this is a serious competitor for Ansible. Happy to answer questions as they arise.
- zwischenzug 10y agoThere are some videos here: https://www.youtube.com/watch?v=zVUPmmUU3yY https://www.youtube.com/watch?v=zVUPmmUU3yY https://www.youtube.com/watch?v=UGp16yvSrFE https://www.youtube.com/watch?v=UGp16yvSrFE And I've blogged quite a bit about ShutIt use cases here: http://zwischenzugs.wordpress.com/ http://zwischenzugs.wordpress.com/ and the genesis of ShutIt and Docker: https://www.youtube.com/watch?v=-qHwL8C9UoA https://www.youtube.com/watch?v=-qHwL8C9UoA
- zwischenzug 10y agoAlso, I'm looking for contributors. If you have an interest in usable automation, an expertise in terminal internals, or just want to get involved, please get in touch. @ianmiell
- themckman 10y ago> Why this over Ansible? It's a long story :) As someone who just spent the last year of his life using Ansible, something tells me I already know this story. I feel for you.
- Rafert 10y agoAs someone who hasn't done much with it yet, care to elaborate? It seemed easier for me to grok than Chef.
- Azeralthefallen 10y agoMy life resolves around Ansible and has for the last year and a half. Ansible is a great tool, unfortunately it has a bunch of short comings. Especially now some of these are becoming a major issue. - Its dependence on Python 2.X, unfortunately all the newer OS's have Python 3.X installed by default. While i have a role for installing this manually it isn't super nice. - My main devops project consists of 11 different environments, and it manages nearly 2k servers. Trying to write environment agnostic roles is an absolute nightmare. Furthermore my group_vars, host_vars, and dynamic inventories have turned into spaghetti. Why? Because of how confusing variable precedence becomes, when you get into extremely complex hierarchy of group_vars which can randomly break. - It is really hard to handle cases where playbooks/roles fail and deal with it cleanly. Blocks have helped a bit, but there is no way to grab the exception that caused the playbook to fail. - The yaml syntax becomes messy fast, Jinja2 is powerful but there are times i wish you could just shove a single line of python into places to prevent the huge mess of with_items, register, set_fact, etc. - AWS modules are a very mixed bag. A lot of them are missing features, and there is some very weird issues that apparently boto is the cause of (e.g. they should move to boto3). Even then i need to do a huge amount of boilerplate to launch ec2 instances. - There is no way to share a common group_vars between inventories (all is specific to inventory). Which leads to a lot of duplication. (Yes the symlink trick does work, but causes a bunch of other issues). I still love Ansible and i would pick it over Chef/Puppet. Salt is also another decent one that has made a lot of progress lately.
- emilong 10y agoJust curious how you decide the line between what is handled by ShutIt and what's handled in the shell? For example, from the example on the home page: # Ensure git is installed. This handles different distros gracefully. shutit.install('git') Awesome and very powerful abstraction! Vs the next lines... # If the directory does not exist, we create it if not shutit.file_exists('/opt/shutit',directory=True): shutit.send('mkdir /opt/shutit') Why not just: shutit.send('mkdir -p /opt/shutit') There are a few other examples where I was wondering how you decided to do some operations in ShutIt vs delegating to shell. In fact, some entire examples look simpler to me in shell that you could just send. Does using the ShutIt native commands make things more testable?
- zwischenzug 10y agoThat's just an illustration, not 'ideal' code. Of course mkdir -p serves the same purpose; the point is to show the 'file_exists' function. Mostly it's where using the shell would be painful. Do you have other specific examples?
- emilong 10y agoJust some similar stuff in the asciinema, but I'm thinking that's also just for illustration. Thanks for the clarification!
- zwischenzug 10y agoPleasure. BTW 'install' is really useful, eg here for my home server setup: https://github.com/ianmiell/shutit-home-server/blob/master/Shutitfile https://github.com/ianmiell/shutit-home-server/blob/master/S... so I can port to Centos from Ubuntu pretty easily. PS That's an example of a ShutItFile, which is still a WIP.
- mrb 10y agoI am a firm believer that example code that serves as a reference should illustrate the absolute best practices. "mkdir -p" is the best practice to create a dir that may or may not already exist, therefore this is a bad example (you are teaching some devs who don't know "mkdir -p" a bad practice). If you want to demonstrate the file_exists function, pick a better example. This is the same reason why I dislike, for example, seeing the documentation of a library showing how to perform actions X, Y, and Z, but a footnote says "by the way, there is no error checking in this example". Well then, why use this code as an example? Anyway, sorry for the rant. ShutIt does seem interesting :)
- TempleOSV409 10y agoThe CIA laughs and says, "Yer fucked because we can make an operating system too, just like yours." I say, "You are a retard-nigger who has absolutely no clue what a certified random number is. It's God, retard-nigger. Nothing you can do will succeed against me. Yer fucked. Surrender to the IRA."