From e6be574d344baf9cca85bb4a4704e872b7bf2f11 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 12 Jun 2014 17:53:50 -0700 Subject: [PATCH] Initial whack at an Ansible config playbook --- .gitignore | 2 ++ ansible/ansible.cfg | 3 +++ ansible/config.yml | 28 ++++++++++++++++++++++++ git/.gitconfig | 52 +++++++++++++++++++++++++++++++++++++++++++++ git/.gitignore | 27 +++++++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 .gitignore create mode 100644 ansible/ansible.cfg create mode 100644 ansible/config.yml create mode 100644 git/.gitconfig create mode 100644 git/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd85c70 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.hosts +*.private diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 0000000..b5714db --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +hostfile = my.hosts +# ask_sudo_pass = True diff --git a/ansible/config.yml b/ansible/config.yml new file mode 100644 index 0000000..fa2e09a --- /dev/null +++ b/ansible/config.yml @@ -0,0 +1,28 @@ +- hosts: all + tasks: + - group_by: key={{ ansible_distribution }} +- hosts: MacOSX + gather_facts: false + tasks: + - name: install dependencies + homebrew: name={{ item }} state=present + with_items: + - git + - stow +- hosts: Debian + gather_facts: false + tasks: + - name: install dependencies + apt: pkg={{ item }} state=present + with_items: + - git + - stow +- hosts: all + gather_facts: false + tasks: + - name: clone dotfiles + git: repo=https://github.com/kejadlen/dotfiles.git dest=~/.dotfiles + - name: stow files + command: stow --target={{ ansible_env.HOME }} --stow {{ ansible_env.HOME }}/.dotfiles/{{ item }} + with_items: + - git diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..74d251f --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,52 @@ +[include] + path = ~/.gitconfig.private +[color] + ui = auto + diff = true +[core] + autocrlf = false + safecrlf = true + excludesfile = /Users/alpha/.gitignore + quotepath = false +[alias] + ; hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short + co = checkout + g = grep --break --heading --line-number + standup = "!git log --all --date=short --no-merges --pretty=format:\"%h %ad %s%d\" --since=1.weeks --author=`git config user.email`" + ; ready = rebase -i @{u} + ready = rebase -i develop + lol = log --graph --decorate --pretty=oneline --abbrev-commit + lola = log --graph --decorate --pretty=oneline --abbrev-commit --all + ; ancestor = merge-base + s = status -sb + latest = for-each-ref --count=20 --sort=-committerdate --format='%(committerdate:short) %(refname:short)' + root = !pwd +[difftool "sourcetree"] + cmd = opendiff \"$LOCAL\" \"$REMOTE\" + path = +[mergetool "sourcetree"] + cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" + trustExitCode = true +[push] + default = current +[difftool "kaleidoscope"] + cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" +[mergetool "kaleidoscope"] + cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot + trustExitCode = true +[grep] + extendRegexp = true + lineNumber = true +[pull] + rebase = true +[apply] + whitespace = warn +[merge] + conflictstyle = diff3 + ff = false +[init] + templatedir = /Users/alpha/.git_templates +[diff] + algorithm = patience +[fetch] + prune = true diff --git a/git/.gitignore b/git/.gitignore new file mode 100644 index 0000000..a18e49b --- /dev/null +++ b/git/.gitignore @@ -0,0 +1,27 @@ +# vim +doc/tags + +# direnv +.envrc + +# Ruby +.bundle + +# OS X +.DS_Store + +# Xcode +build/* +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside