3 ms·
Why ansible? I'm storing my dotfiles in a private git repo and sync across multiple laptops. Works fine so far. Put the dotfiles and directories into git. Syml
by buster 12y ago
Why ansible? I'm storing my dotfiles in a private git repo and sync across multiple laptops. Works fine so far.
Put the dotfiles and directories into git. Symlink from ~/.vim to ~/dotfiles/.vim and be done with it. (~/dotfiles would contain the git checkout of course).
- shock 12y agoI think that's the better way to to it (at least compared to ansible/chef/puppet/etc). I additionally use GNU Stow for doing the symlinking.
- buster 12y agoSounds interesting. Could you explain a bit more how this works, briefly? I find the GNU stow page not really good to understand and lack some example of how it would be used...
- captn3m0 12y agoI recently shifted to stow as well. You can see my configuration on github[0]. [0]: http://github.com/captn3m0/dotfiles http://github.com/captn3m0/dotfiles
- shock 12y agoSure, I use a pretty simple setup: I have a ~/dotfiles directory in which I have one directory for each program/entity I want to manage using stow. Let's say I want to manage my GNOME keyrings and my settings for the program EasyStroke. My ~/dotfiles directory would look like this: ~/dotfiles ├── easystroke │ └── .easystroke │ ├── actions-0.5.6 │ └── preferences-0.5.5 └── keyrings └── .local └── share └── keyrings ├── login.keyring └── user.keystore Then, in ~/dotfiles I can do "stow easystroke" and it will create ~/.easystroke and there it will symlink "actions-0.5.6" to ~/dotfiles/easystroke/.easystroke/ actions-0.5.6 and "preferences-0.5.5" to ~/dotfiles/easystroke/.easystroke/preferences-0.5.5
- icebraining 12y agoWhat's the advantage over doing (assuming GNU cp): cp -sr ~/dotfiles/easystroke/.easystroke ~/
- shock 12y agoStow can handle multiple directories in one go. For my powerline config: vim-powerlinefonts ├── .config │ └── fontconfig │ └── conf.d │ └── 10-powerline-symbols.conf └── .local └── share └── fonts └── PowerlineSymbols.otf I just do "stow vim-powerlinefonts" and it creates the directories and symlinks as needed. For your cp example I would have to do "cp -sr ..." twice and also think about missing directories in the tree, and possibly create them.
- mitchty 12y agoQuestion on stow that you might have knowledge on. Could I say have stow manage separate or conflicting files? An example is in order, say for work I have a .gitconfig that has a separate email address etc... and for home I have basically the same but not quite. Would there be any easy-ish way to say something akin to: ok this is the base of things, these are the generalized components that override? I have a jacky way of doing this now but any way to eliminate the nonsense would be helpful. xstow looks interesting however.
- shock 12y agoStow can do that if you only need files to be replaced, not sections of files. Let's say you want to manage the file ~/test/.gitconfig, you can create this structure: $ cd ~/gittest $ tree -a ~/gittest/ ├── gitconfig-home │ └── test │ └── .gitconfig └── gitconfig-work └── test └── .gitconfig $ cat ~/gittest/gitconfig-home/test/.gitconfig git config 1 $ cat ~/gittest/gitconfig-work/test/.gitconfig git config 2 $ stow --no-folding --override='.+/.gitconfig' gitconfig-home $ cat ~/test/.gitconfig git config 1 $ stow --no-folding --override='.+/.gitconfig' gitconfig-work $ cat ~/test/.gitconfig git config 2 If you need to manage sections of files, take a look at dotdee[0] or update-dotdee[1] [0] - https://launchpad.net/dotdee https://launchpad.net/dotdee [1] - https://pypi.python.org/pypi/update-dotdee https://pypi.python.org/pypi/update-dotdee
- palcu 12y agoI was also using a simple bootstrap script and I too felt I was "killing mosquitos with a bazooka" using Ansible. But I wanted to symlink my Sublime settings. That meant tinkering with shell code and separating the files in different dirs. Then I wanted to preinstall my Brew apps, but only for Mac. So these tasks pilled up in shell scripts and became ugly. So Ansible, with it's easy YAML configs, is the perfect tool for a dev like me that wants to setup machines and maintain the configurations synced.
- captn3m0 12y agoYou should take a look at GNU stow. I also felt the same frustration as my bootstrap script got ugly and uglier. And then I shifted to stow. And now its just a single line: stow * --target ~ With respect to ansible, I've been thinking of managing my laptop using just ansible to install new packages, and update configuration (apache, sshd and so on). Kinda like chef-solo, but using ansible. Has anyone done anything like that?
- palcu 12y agoThanks for the tip about Stow, never knew about it and I will research it. Ansible can be used for your local machine without any central server by default. I use this[0] playbook to update my packages daily on my DigitalOcean machines. [0]: https://github.com/palcu/dotfiles/blob/master/playbooks/tasks/ubuntu.yml https://github.com/palcu/dotfiles/blob/master/playbooks/task...