From e9c062766a25dab3e62544b8b763f31b2f881914 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 2 Jan 2015 23:03:17 -0600 Subject: [PATCH] Use geerlingguy.dotfiles role instead of a bunch of custom tasks. --- main.yml | 7 ++++++- requirements.txt | 1 + tasks/dotfiles.yml | 38 -------------------------------------- vars/main.yml | 9 +++++++++ 4 files changed, 16 insertions(+), 39 deletions(-) delete mode 100644 tasks/dotfiles.yml diff --git a/main.yml b/main.yml index 2cdb4d8..a5290bb 100644 --- a/main.yml +++ b/main.yml @@ -8,8 +8,13 @@ roles: - geerlingguy.homebrew + - geerlingguy.dotfiles tasks: - include: tasks/ansible-setup.yml - - include: tasks/dotfiles.yml - include: tasks/preferences.yml + + # TODO: Use sudo once .osx can be run via root with no user interaction. + - name: Run .osx dotfiles. + shell: ~/.osx --no-restart + changed_when: false diff --git a/requirements.txt b/requirements.txt index 2950aa4..2300de8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +geerlingguy.dotfiles geerlingguy.homebrew diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml deleted file mode 100644 index 0f4c43e..0000000 --- a/tasks/dotfiles.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# 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 - failed_when: false - always_run: yes - 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: Use sudo once .osx can be run via root with no user interaction. -- name: Run .osx dotfiles. - shell: ~/.osx --no-restart - changed_when: false diff --git a/vars/main.yml b/vars/main.yml index 6e4b8a5..8d349c1 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,15 @@ --- downloads: ~/.ansible-downloads/ +dotfiles_repo: https://github.com/geerlingguy/dotfiles.git +dotfiles_repo_local_destination: ~/Dropbox/Development/GitHub/dotfiles +dotfiles_files: + - .bash_profile + - .gitignore + - .inputrc + - .osx + - .vimrc + homebrew_installed_packages: - ansible - autoconf