[ansible] Add role for OS X
change
commit 0c176eb92a0ed77a196e16074e6bff1ab350dfe4
author Alpha Chen <alpha.chen@gmail.com>
date
parent 8b4bcad2
diff --git a/ansible/hosts b/ansible/hosts
new file mode 100644
index 00000000..8bb7ba6b
--- /dev/null
+++ b/ansible/hosts
@@ -0,0 +1,2 @@
+[local]
+localhost
diff --git a/ansible/main.yml b/ansible/main.yml
new file mode 100644
index 00000000..fe8bef38
--- /dev/null
+++ b/ansible/main.yml
@@ -0,0 +1,5 @@
+- hosts: local
+  connection: local
+  roles:
+    - osx
+    - dotfiles
diff --git a/ansible/roles/dotfiles/tasks/main.yml b/ansible/roles/dotfiles/tasks/main.yml
new file mode 100644
index 00000000..ed97d539
--- /dev/null
+++ b/ansible/roles/dotfiles/tasks/main.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/osx/tasks/casks.yml b/ansible/roles/osx/tasks/casks.yml
new file mode 100644
index 00000000..55fa8819
--- /dev/null
+++ b/ansible/roles/osx/tasks/casks.yml
@@ -0,0 +1,5 @@
+---
+# - homebrew: name=caskroom/cask/brew-cask state=upgraded
+- command: brew install caskroom/cask/brew-cask
+- homebrew_cask: name={{ item }}
+  with_items: casks
diff --git a/ansible/roles/osx/tasks/fonts.yml b/ansible/roles/osx/tasks/fonts.yml
new file mode 100644
index 00000000..e967c023
--- /dev/null
+++ b/ansible/roles/osx/tasks/fonts.yml
@@ -0,0 +1,4 @@
+---
+- homebrew_tap: tap=caskroom/fonts
+- homebrew_cask: name={{ item }}
+  with_items: fonts
diff --git a/ansible/roles/osx/tasks/homebrew.yml b/ansible/roles/osx/tasks/homebrew.yml
new file mode 100644
index 00000000..8ce07cf4
--- /dev/null
+++ b/ansible/roles/osx/tasks/homebrew.yml
@@ -0,0 +1,5 @@
+---
+- homebrew: name={{ item }} state=upgraded
+  with_items: formulae
+- homebrew: name=macvim install_options=override-system-vim state=upgraded
+- command: brew linkapps
diff --git a/ansible/roles/osx/tasks/main.yml b/ansible/roles/osx/tasks/main.yml
new file mode 100644
index 00000000..f44e57c6
--- /dev/null
+++ b/ansible/roles/osx/tasks/main.yml
@@ -0,0 +1,5 @@
+---
+- homebrew: update_homebrew=yes
+- include: homebrew.yml
+- include: casks.yml
+- include: fonts.yml
diff --git a/ansible/roles/osx/vars/main.yml b/ansible/roles/osx/vars/main.yml
new file mode 100644
index 00000000..2bc7e136
--- /dev/null
+++ b/ansible/roles/osx/vars/main.yml
@@ -0,0 +1,28 @@
+---
+formulae:
+  - chruby
+  - ctags
+  - fasd
+  - git
+  # - macvim # Needs install_options=override-system-vim
+  - ruby-install
+  - reattach-to-user-namespace
+  - the_silver_searcher
+  - tmux
+  - youtube-dl
+casks:
+  - adium
+  - dropbox
+  - google-chrome
+  - firefox
+  - moom
+  - plug
+  - qlmarkdown
+  - qlstephen
+  - quicklook-csv
+  - quicklook-json
+  - steam
+  - things
+  - ynab
+fonts:
+  - font-sauce-code-powerline