From 8f8ea4a8e54a6cf65e85196f303d33ce732f6034 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 2 Oct 2014 23:07:02 -0500 Subject: [PATCH] Completely revamped the playbook. Let homebrew and cask do the hard work. --- apps/adium.yml | 15 ------ apps/chrome.yml | 15 ------ apps/cornerstone.yml | 14 ----- apps/dropbox.yml | 9 ---- apps/firefox.yml | 15 ------ apps/handbrake.yml | 15 ------ apps/homebrew.yml | 13 ----- apps/knock.yml | 14 ----- apps/menumeters.yml | 17 ------- apps/nvalt.yml | 14 ----- apps/pckeyboardhack.yml | 16 ------ apps/sequel-pro.yml | 15 ------ apps/skype.yml | 15 ------ apps/sublime.yml | 36 ------------- apps/tower.yml | 14 ----- apps/transmit.yml | 14 ----- apps/vagrant.yml | 16 ------ apps/virtualbox.yml | 16 ------ apps/vlc.yml | 15 ------ install/app.yml | 3 -- install/dmg.yml | 24 --------- install/homebrew.yml | 3 -- install/pkg.yml | 4 -- install/tar.yml | 20 -------- install/zip.yml | 26 ---------- main.yml | 50 +++++++++--------- preferences/dotfiles.yml | 29 ----------- preferences/preferences.yml | 8 --- tasks/dotfiles.yml | 36 +++++++++++++ tasks/preferences.yml | 12 +++++ .../sublime/Package Control.sublime-settings | 1 - vars/main.yml | 51 +++++++++++++++++++ 32 files changed, 122 insertions(+), 443 deletions(-) delete mode 100644 apps/adium.yml delete mode 100644 apps/chrome.yml delete mode 100644 apps/cornerstone.yml delete mode 100644 apps/dropbox.yml delete mode 100644 apps/firefox.yml delete mode 100644 apps/handbrake.yml delete mode 100644 apps/homebrew.yml delete mode 100644 apps/knock.yml delete mode 100644 apps/menumeters.yml delete mode 100644 apps/nvalt.yml delete mode 100644 apps/pckeyboardhack.yml delete mode 100644 apps/sequel-pro.yml delete mode 100644 apps/skype.yml delete mode 100644 apps/sublime.yml delete mode 100644 apps/tower.yml delete mode 100644 apps/transmit.yml delete mode 100644 apps/vagrant.yml delete mode 100644 apps/virtualbox.yml delete mode 100644 apps/vlc.yml delete mode 100644 install/app.yml delete mode 100644 install/dmg.yml delete mode 100644 install/homebrew.yml delete mode 100644 install/pkg.yml delete mode 100644 install/tar.yml delete mode 100644 install/zip.yml delete mode 100644 preferences/dotfiles.yml delete mode 100644 preferences/preferences.yml create mode 100644 tasks/dotfiles.yml create mode 100644 tasks/preferences.yml create mode 100644 vars/main.yml diff --git a/apps/adium.yml b/apps/adium.yml deleted file mode 100644 index c8724d4..0000000 --- a/apps/adium.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Adium - app_name_pretty: Adium - app_url: "http://downloads.sourceforge.net/project/adium/Adium_1.5.9.dmg?r=&ts=1392301195&use_mirror=softlayer-ams" - installer_type: app - install_method: dmg - mount_path: /Volumes/Adium\ 1.5.9/ - creates: /Applications/Adium.app - downloads: ~/.ansible-downloads/ - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/chrome.yml b/apps/chrome.yml deleted file mode 100644 index 13fa937..0000000 --- a/apps/chrome.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Google\ Chrome - app_name_pretty: Google Chrome - app_url: "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" - installer_type: app - install_method: dmg - mount_path: /Volumes/Google\ Chrome/ - creates: /Applications/Google\ Chrome.app - downloads: ~/.ansible-downloads/ - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/cornerstone.yml b/apps/cornerstone.yml deleted file mode 100644 index 113fbb2..0000000 --- a/apps/cornerstone.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Cornerstone - app_name_pretty: Cornerstone - app_url: "http://www.zennaware.com/mint/pepper/orderedlist/downloads/download.php?file=http%3A//www.zennaware.com/cornerstone/downloads/Cornerstone-2.7.11.zip" - installer_type: app - install_method: zip - downloads: ~/.ansible-downloads/ - creates: /Applications/Cornerstone.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/dropbox.yml b/apps/dropbox.yml deleted file mode 100644 index ae279c8..0000000 --- a/apps/dropbox.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Note: Once downloaded, you will need to manually run Dropbox to setup. -# TODO: Maybe still use normal DMG routine for the install instead of sh? -- hosts: all - connection: local - - tasks: - - name: Install Dropbox. - shell: curl -fkL https://gist.github.com/raw/963046/install-dropbox.sh | sh creates=/Applications/Dropbox.app \ No newline at end of file diff --git a/apps/firefox.yml b/apps/firefox.yml deleted file mode 100644 index c921dff..0000000 --- a/apps/firefox.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Firefox - app_name_pretty: Firefox - app_url: "https://download.mozilla.org/?product=firefox-27.0&os=osx&lang=en-US" - installer_type: app - install_method: dmg - mount_path: /Volumes/Firefox/ - downloads: ~/.ansible-downloads/ - creates: /Applications/Firefox.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/handbrake.yml b/apps/handbrake.yml deleted file mode 100644 index d380f09..0000000 --- a/apps/handbrake.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: HandBrake - app_name_pretty: HandBrake - app_url: "http://handbrake.fr/rotation.php?file=HandBrake-0.9.9-MacOSX.6_GUI_x86_64.dmg" - installer_type: app - install_method: dmg - mount_path: /Volumes/HandBrake-0.9.9-MacOSX.6_GUI_x86_64/ - downloads: ~/.ansible-downloads/ - creates: /Applications/HandBrake.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/homebrew.yml b/apps/homebrew.yml deleted file mode 100644 index 43c4232..0000000 --- a/apps/homebrew.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- hosts: all - connection: local - - tasks: - - name: Install Xcode CLI tools - shell: /usr/bin/xcode-select --install creates=/usr/bin/gcc - sudo: yes - - - name: Run Homebrew install script - shell: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" creates=/usr/local/bin/brew - register: brew_result - sudo: yes diff --git a/apps/knock.yml b/apps/knock.yml deleted file mode 100644 index 5c5cd19..0000000 --- a/apps/knock.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Knock - app_name_pretty: Knock - app_url: "http://knocktounlock.com/download" - installer_type: app - install_method: zip - downloads: ~/.ansible-downloads/ - creates: /Applications/Knock.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/menumeters.yml b/apps/menumeters.yml deleted file mode 100644 index 047ed71..0000000 --- a/apps/menumeters.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# TODO: This uses a custom installer. Might be able to install from source. -- hosts: all - connection: local - vars: - app_name: Menu\ Meters - app_name_pretty: Menu\ Meters - app_url: "http://www.ragingmenace.com/software/download/MenuMeters.dmg" - installer_type: pkg - install_method: dmg - install_target: /Volumes/Macintosh\ HD - mount_path: /Volumes/Menu\ Meters\ 1.6.1/ - creates: /Applications/Menu\ Meters.app - downloads: ~/.ansible-downloads/ - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/nvalt.yml b/apps/nvalt.yml deleted file mode 100644 index fb1efa5..0000000 --- a/apps/nvalt.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: nvALT - app_name_pretty: nvALT - app_url: "http://abyss.designheresy.com/nvaltb/nvalt2.2b106.zip" - installer_type: app - install_method: zip - downloads: ~/.ansible-downloads/ - creates: /Applications/nvALT.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/pckeyboardhack.yml b/apps/pckeyboardhack.yml deleted file mode 100644 index 94c4735..0000000 --- a/apps/pckeyboardhack.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: PCKeyboardHack - app_name_pretty: PCKeyboardHack - app_url: "https://pqrs.org/macosx/keyremap4macbook/files/PCKeyboardHack-10.5.0.dmg" - installer_type: pkg - install_method: dmg - install_target: /Volumes/Macintosh\ HD - mount_path: /Volumes/PCKeyboardHack-10.5.0/ - downloads: ~/.ansible-downloads/ - creates: /Applications/PCKeyboardHack.app - - tasks: - - include: ../install/{{ install_method }}.yml diff --git a/apps/sequel-pro.yml b/apps/sequel-pro.yml deleted file mode 100644 index f65cc78..0000000 --- a/apps/sequel-pro.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Sequel\ Pro - app_name_pretty: Sequel Pro - app_url: "https://sequel-pro.googlecode.com/files/sequel-pro-1.0.2.dmg" - installer_type: app - install_method: dmg - mount_path: /Volumes/Sequel\ Pro\ 1.0.2/ - downloads: ~/.ansible-downloads/ - creates: /Applications/Sequel\ Pro.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/skype.yml b/apps/skype.yml deleted file mode 100644 index 0d0d27b..0000000 --- a/apps/skype.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Skype - app_name_pretty: Skype - app_url: "http://www.skype.com/go/getskype-macosx.dmg" - installer_type: app - install_method: dmg - mount_path: /Volumes/Skype/ - downloads: ~/.ansible-downloads/ - creates: /Applications/Skype.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/sublime.yml b/apps/sublime.yml deleted file mode 100644 index 2beab10..0000000 --- a/apps/sublime.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# Sublime Text. -# Note: Currently, to complete installation, you have to manually install -# Package Control; see: https://sublime.wbond.net/installation. -- hosts: all - connection: local - vars: - app_name: Sublime\ Text - app_name_pretty: Sublime\ Text - app_url: "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203059.dmg" - installer_type: app - install_method: dmg - mount_path: /Volumes/Sublime\ Text/ - downloads: ~/.ansible-downloads/ - creates: /Applications/Sublime\ Text.app - - tasks: - - include: ../install/{{ install_method }}.yml - - - name: Create symlink subl for Sublime Text's subl command - file: src=/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl dest=/usr/bin/subl state=link - sudo: true - - - name: Create symlink sublime for Sublime Text's subl command - file: src=/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl dest=/usr/bin/sublime state=link - sudo: true - - - name: Copy Sublime settings files. - copy: "src='../templates/sublime/{{ item }}' dest='~/Library/Application\ Support/Sublime\ Text 3/Packages/User/{{ item }}'" - sudo: no - with_items: - - "Default (OSX).sublime-keymap" - - "Package Control.sublime-settings" - - "Preferences.sublime-settings" - # - name: "Copy settings (example, don't use)." - # shell: cp -r init/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null diff --git a/apps/tower.yml b/apps/tower.yml deleted file mode 100644 index 1e42c5f..0000000 --- a/apps/tower.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Tower - app_name_pretty: Tower - app_url: "https://macapps.fournova.com/tower1-1060/download" - installer_type: app - install_method: zip - downloads: ~/.ansible-downloads/ - creates: /Applications/Tower.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/transmit.yml b/apps/transmit.yml deleted file mode 100644 index 1a5603a..0000000 --- a/apps/transmit.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Transmit - app_name_pretty: Transmit - app_url: "http://download.panic.com/transmit/Transmit%204.4.6.zip" - installer_type: app - install_method: zip - downloads: ~/.ansible-downloads/ - creates: /Applications/Transmit.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/vagrant.yml b/apps/vagrant.yml deleted file mode 100644 index a8f3307..0000000 --- a/apps/vagrant.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: Vagrant - app_name_pretty: Vagrant - app_url: "https://dl.bintray.com/mitchellh/vagrant/Vagrant-1.4.3.dmg" - installer_type: pkg - install_method: dmg - install_target: /Volumes/Macintosh\ HD - mount_path: /Volumes/Vagrant/ - downloads: ~/.ansible-downloads/ - creates: /Applications/Vagrant/bin/vagrant - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/virtualbox.yml b/apps/virtualbox.yml deleted file mode 100644 index b448147..0000000 --- a/apps/virtualbox.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: VirtualBox - app_name_pretty: VirtualBox - app_url: "http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-OSX.dmg" - mount_path: /Volumes/VirtualBox/ - installer_type: pkg - install_method: dmg - install_target: /Volumes/Macintosh\ HD - downloads: ~/.ansible-downloads/ - creates: /Applications/VirtualBox.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/apps/vlc.yml b/apps/vlc.yml deleted file mode 100644 index 78e5cf5..0000000 --- a/apps/vlc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - connection: local - vars: - app_name: VLC - app_name_pretty: VLC - app_url: "http://get.videolan.org/vlc/2.1.3/macosx/vlc-2.1.3.dmg" - installer_type: app - install_method: dmg - mount_path: /Volumes/vlc-2.1.3/ - downloads: ~/.ansible-downloads/ - creates: /Applications/VLC.app - - tasks: - - include: ../install/{{ install_method }}.yml \ No newline at end of file diff --git a/install/app.yml b/install/app.yml deleted file mode 100644 index dfcd9f2..0000000 --- a/install/app.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Copy {{ app_name_pretty }} app to Applications directory - command: cp -R {{ app_name }}.app /Applications chdir={{ downloads }} creates=/Applications/{{ app_name }}.app \ No newline at end of file diff --git a/install/dmg.yml b/install/dmg.yml deleted file mode 100644 index e199e2e..0000000 --- a/install/dmg.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Download {{ app_name_pretty }} - get_url: url={{ app_url }} dest={{ downloads }}/{{ app_name }}.dmg - -- name: Mount {{ app_name_pretty }} image - command: hdiutil attach {{ app_name }}.dmg chdir={{ downloads }} creates={{ creates }} - -- name: Copy {{ app_name_pretty }} app to Applications directory - command: cp -R {{ mount_path }}{{ app_name }}.app /Applications creates={{ creates }} - when: "installer_type == 'app'" - -- name: Install {{ app_name_pretty }} pkg - command: installer -package {{ mount_path }}{{ app_name }}.pkg -target {{ install_target }} creates={{ creates }} - sudo: yes - when: "installer_type == 'pkg'" - -- name: Check if image is mounted - shell: "[ -d {{ mount_path }} ] && echo '1' || echo '0'" - changed_when: false - register: mount_exists - -- name: Unmount {{ app_name_pretty }} image - command: hdiutil detach {{ mount_path }} - when: "mount_exists.stdout == '1'" \ No newline at end of file diff --git a/install/homebrew.yml b/install/homebrew.yml deleted file mode 100644 index 278e7be..0000000 --- a/install/homebrew.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Install {{ app_name_pretty }} via Homebrew - homebrew: name={{ app_name }} state=installed update_homebrew=yes \ No newline at end of file diff --git a/install/pkg.yml b/install/pkg.yml deleted file mode 100644 index 526cd18..0000000 --- a/install/pkg.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# TODO: Idempotence. -- name: Install {{ app_name }} pkg - command: sudo installer -package {{ app_name }}.pkg -target {{ install_target }} creates={{ creates }} \ No newline at end of file diff --git a/install/tar.yml b/install/tar.yml deleted file mode 100644 index 2f084a1..0000000 --- a/install/tar.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Download {{ app_name_pretty }} - get_url: url={{ app_url }} dest={{ downloads }}/{{ app_name }}.tar -- name: Remove existing extraction directory if present - file: path={{ downloads }}{{ app_name }}/ state=absent -- name: Create an extraction directory - file: path={{ downloads }}{{ app_name }}/ state=directory -- name: Extract {{ app_name_pretty }} tarball - command: tar xf {{ app_name }}.tar -C {{ app_name }}/ chdir={{ downloads }} -- name: Remove existing app if present - file: path=/Applications/{{ app_name }}.app state=absent - when: "installer_type == 'app'" -- name: Copy {{ app_name_pretty }} app to Applications directory - command: cp -R {{ app_name }}/{{ app_name }}.app /Applications chdir={{ downloads }} - when: "installer_type == 'app'" -- name: Install {{ app_name_pretty }} pkg - command: sudo installer -package {{ app_name }}/{{ app_name }}.pkg -target {{ install_target }} chdir={{ downloads }} - when: "installer_type == 'pkg'" -- name: Remove extraction directory - file: path={{ downloads }}{{ app_name }}/ state=absent \ No newline at end of file diff --git a/install/zip.yml b/install/zip.yml deleted file mode 100644 index 44739e9..0000000 --- a/install/zip.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: Download {{ app_name_pretty }} - get_url: url={{ app_url }} dest={{ downloads }}/{{ app_name }}.zip - -- name: Check if application is already installed. - shell: "[ -f {{ creates }} ] && echo '1' || echo '0'" - changed_when: false - register: installed - -- name: Create an extraction directory - file: path={{ downloads }}{{ app_name }}/ state=directory - when: "installed.stdout == '1'" - -- name: Extract {{ app_name_pretty }} zip archive - command: unzip {{ app_name }}.zip -d {{ app_name }}/ chdir={{ downloads }} creates={{ creates }} - -- name: Copy {{ app_name_pretty }} app to Applications directory - command: cp -R {{ app_name }}/{{ app_name }}.app /Applications chdir={{ downloads }} creates={{ creates }} - when: "installer_type == 'app'" - -- name: Install {{ app_name_pretty }} pkg - command: sudo installer -package {{ app_name }}/{{ app_name }}.pkg -target {{ install_target }} chdir={{ downloads }} creates={{ creates }} - when: "installer_type == 'pkg'" - -- name: Ensure extraction directory is gone - file: path={{ downloads }}{{ app_name }}/ state=absent \ No newline at end of file diff --git a/main.yml b/main.yml index 1f91e46..3b5a359 100644 --- a/main.yml +++ b/main.yml @@ -1,34 +1,30 @@ --- -- name: Mac Development Playbook - hosts: self +- hosts: self user: jgeerling connection: local - vars: - - downloads: ~/.ansible-downloads/ + vars_files: + - vars/main.yml + + roles: + - geerlingguy.homebrew tasks: - - name: Create Ansible downloads directory - file: path={{ downloads }} state=directory - - include: preferences/dotfiles.yml - - include: preferences/preferences.yml + - name: Ensure Ansible downloads directory exists. + file: + path: "{{ downloads }}" + state: directory -- include: apps/adium.yml -- include: apps/chrome.yml -- include: apps/cornerstone.yml -- include: apps/dropbox.yml -- include: apps/firefox.yml -- include: apps/handbrake.yml -- include: apps/homebrew.yml -- include: apps/knock.yml -# - include: apps/menumeters.yml -- include: apps/nvalt.yml -- include: apps/pckeyboardhack.yml -- include: apps/sequel-pro.yml -- include: apps/skype.yml -- include: apps/sublime.yml -- include: apps/tower.yml -- include: apps/transmit.yml -- include: apps/vagrant.yml -- include: apps/virtualbox.yml -- include: apps/vlc.yml \ No newline at end of file + - include: tasks/dotfiles.yml + - include: tasks/preferences.yml + + - name: Get list of apps installed with cask. + command: brew cask list + register: homebrew_cask_list + changed_when: false + + - name: Install apps via `brew cask`. + command: > + brew cask install {{ item }} --appdir={{ homebrew_cask_appdir }} + with_items: homebrew_cask_apps + when: "'{{ item }}' not in homebrew_cask_list.stdout" diff --git a/preferences/dotfiles.yml b/preferences/dotfiles.yml deleted file mode 100644 index 4920f5e..0000000 --- a/preferences/dotfiles.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# Install Jeff Geerling's dotfiles. -- name: Clone dotfiles repository into temporary location. - git: > - repo=https://github.com/geerlingguy/dotfiles.git - dest=~/Dropbox/Development/GitHub/dotfiles - sudo: no - -- name: Check if .bash_profile is a link. - shell: ls -F ~/.bash_profile - register: is_link - changed_when: false - -- name: Remove current .bash_profile file if necessary. - file: path=~/.bash_profile state=absent - when: "'@' not in is_link.stdout" - -- name: Link dotfiles into home folder. - file: src=~/Dropbox/Development/GitHub/dotfiles/{{ item }} dest=~/{{ item }} state=link - sudo: no - with_items: - - .bash_profile - - .gitignore - - .inputrc - - .osx - - .vimrc - -- name: Run .osx dotfiles. - shell: date diff --git a/preferences/preferences.yml b/preferences/preferences.yml deleted file mode 100644 index 2e6d3c2..0000000 --- a/preferences/preferences.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Preferences. -# TODO: Idempotence, and set it as the default. -# - name: Add Terminal settings. -# shell: open templates/terminal/JJG-Term.terminal - -# TODO: Make these happen. -# git config --global color.ui true diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml new file mode 100644 index 0000000..62a6cde --- /dev/null +++ b/tasks/dotfiles.yml @@ -0,0 +1,36 @@ +--- +# Install Jeff Geerling's dotfiles. +- name: Clone dotfiles repository (if it doesn't already exist). + git: + repo: https://github.com/geerlingguy/dotfiles.git + dest: ~/Dropbox/Development/GitHub/dotfiles + sudo: no + +- name: Check if .bash_profile is a link. + shell: ls -F ~/.bash_profile + register: is_link + changed_when: false + +- name: Remove current .bash_profile file if necessary. + file: + path: ~/.bash_profile + state: absent + when: "'@' not in is_link.stdout" + +- name: Link dotfiles into home folder. + file: + src: "~/Dropbox/Development/GitHub/dotfiles/{{ item }}" + dest: "~/{{ item }}" + state: link + sudo: no + with_items: + - .bash_profile + - .gitignore + - .inputrc + - .osx + - .vimrc + +# TODO - This requires sudo password (interactive prompt)... AND it restarts +# Terminal, thus ending the playbook run. D'oh! +# - name: Run .osx dotfiles. +# shell: ~/.osx diff --git a/tasks/preferences.yml b/tasks/preferences.yml new file mode 100644 index 0000000..ee5e0a4 --- /dev/null +++ b/tasks/preferences.yml @@ -0,0 +1,12 @@ +--- +# Preferences. +# TODO: Idempotence, and set it as the default. +# - name: Add Terminal settings. +# shell: open templates/terminal/JJG-Term.terminal + +# TODO: Configure Sublime Text (see templates/sublime/*). + +# TODO: Configure git (should this be in my .osx file, though?). +# git config --global color.ui true +# git config --global user.name "Jeff Geerling" +# git config --global user.email "geerlingguy@mac.com" diff --git a/templates/sublime/Package Control.sublime-settings b/templates/sublime/Package Control.sublime-settings index 5c80f30..21fcd1f 100644 --- a/templates/sublime/Package Control.sublime-settings +++ b/templates/sublime/Package Control.sublime-settings @@ -5,7 +5,6 @@ "DocBlockr", "Drupal Snippets", "FileDiffs", - "Git", "GitHub Flavored Markdown Preview", "Goto Documentation", "Goto Drupal API", diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..257709e --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,51 @@ +--- +downloads: ~/.ansible-downloads/ + +homebrew_installed_packages: + - autoconf + - gettext + - libevent + - packer + - python + - sqlite + - mysql + - phpunit + - ssh-copy-id + - cowsay + - ios-sim + - readline + - subversion + - kdiff3 + - openssl + - pv + - wget + # - caskroom/cask/brew-cask + +homebrew_taps: + - caskroom/cask + - homebrew/binary + - homebrew/dupes + - homebrew/php + - homebrew/versions + +homebrew_cask_appdir: /Applications +homebrew_cask_apps: + - adium + - google-chrome + - dropbox + - firefox + - handbrake + - menumeters + - nvalt + - sequel-pro + - skype + - skitch + - sublime-text # Note - Sublime Text 2 only, at this time... + - tower + - transmit + - vlc + # TODO - Would these potentially break existing installs on current Mac? + # - vagrant + # - virtualbox + # TODO - No cask available (yet). + # Seil (https://pqrs.org/osx/karabiner/seil.html.en)