6 ms·
Ansible is great and all, but I've been using a bash_profile to set up my workstations for years and it's worked great. Doesn't require third-party tools and us
by nunez 10y ago
Ansible is great and all, but I've been using a bash_profile to set up my workstations for years and it's worked great. Doesn't require third-party tools and uses bash, so it can literally run on anything, including Cygwin and LXSS (Windows).
For those interested: https://github.com/carlosonunez/setup https://github.com/carlosonunez/setup
- dqv 10y agoAh, a very seasoned bash profile. Thanks for sharing.
- rajangdavis 10y agoWhat is the stayfocusd.json for? It looks like it's for blocking certain sites but how does it work?
- nunez 10y agoI used a Chrome Extension called StayFocusd to block out time wasting sites while trying to get some work done. That JSON configures its settings. Haven't needed that extension for a while because I'm actually busy these days!
- ykler 10y agoI don't have a problem with third party tools or need to run a setup scrip on Cygwin or LXSS, but shell scripting just seems easier than a tool like ansible because you have a full programming language (albeit a terrible one), and you can use familiar command line utilities to do everything. (You can use them in ansible too, but it is frowned on -- you are supposed to relearn how to do everything using modules that are usually less powerful than the equivalent command line utilities.) I have never had to manage a huge fleet of servers, so maybe ansible has advantages in that setting, but for setting up a single box it just seems to make everything harder.
- geerlingguy 10y agoWhen you have three+ Macs to configure, it starts looking more like a fleet and less like a single computer :) The main advantage I see is at it's a lot easier to reason with Yaml configuration than shell scripts with a ton of conditionals, and it's also easier to use Ansible's modules to make sure you can reprovision whenever you want to get new things added or old things removed.
- StavrosK 10y agoThat's exactly my use case as well, which I detailed in a writeup: https://www.stavros.io/posts/provisioning-your-computer-one-command-awesome/ https://www.stavros.io/posts/provisioning-your-computer-one-... It's a great way to synchronize state between computers, including installed packages, fonts, Vim plugins, etc. It goes much further than dotfiles.
- gnosek 10y agoI'm a fan of Ansible, so let me reply to a few of your points :) 1. Playbooks are not a complete programming language for a good reason. You just get a simple linear flow of tasks with limited loops and conditions, so they're hard to make unreadable, unlike full-blown programming languages, like Python in Fabric or Ruby in Chef. 2. Yes, using shell commands for things that can be done using modules is frowned upon, but nobody is going to physically frown at you, so don't worry about it too much :) I drop down to shell/command/script modules whenever I need to without giving it a single thought. 3. Yes, the modules are often less powerful than the underlying tools. The other side is that they return nicely parsed data and changed/not changed status, so you can analyze their results more easily than shell commands. 4. Yes, ansible has immense advantages over shell scripting whenever one or more applies (generally the "manage a fleet of servers" scenario, not the "set up a dev box" one): - you need to coordinate configuration between multiple machines (sshing back and forth is just clumsy in comparison) - the playbook is to be used more than once (e.g. evolving configuration) -- I can't imagine my life right now without diffs and check mode. This also makes developing/debugging playbooks much easier than scripts, e.g. I recently wrote a hairy migration tool as a playbook and could easily see all the changes it would do without applying them - some things are just easier in ansible (template and lineinfile come to the top of my head, plus everything is parsed for you into easily usable data structures) 5. I'd probably use ansible to set up my own machine if I ever got to automating the task, but you're right: learning ansible just for that makes little sense.
- akshatpradhan 10y agoHave you seen Strap? Strap is a script to bootstrap a minimal OS X development system. This does not assume you're doing Ruby/Rails/web development but installs the minimal set of software every OS X developer will want. http://mikemcquaid.com/2016/06/15/replacing-boxen/ http://mikemcquaid.com/2016/06/15/replacing-boxen/ https://github.com/MikeMcQuaid/strap https://github.com/MikeMcQuaid/strap