dotfiles.yml

Fri, 10 Feb 2017 03:23:06 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 10 Feb 2017 03:23:06 -0500
changeset 47
9706ed9b8f06
parent 43
31d5f9b7cff2
permissions
-rw-r--r--

fix

---
# This is a playbook to run as myself, with agent forwarding, to pull down my
# private dotfiles and set up.

- hosts: devbox
  gather_facts: false
  tasks:
    - name: Clone dotfiles
      shell: >
        hg clone -U {{dotfiles_repository | quote}} _dotfiles_
        && mv _dotfiles_/.hg .
        && rmdir _dotfiles_
        && hg -R ~ update -C
      args:
        chdir: "~"
        creates: "~/.hg"

    - name: Update dotfiles
      command: hg pull -u
      args:
        chdir: "~"
      register: update_dotfiles
      changed_when: update_dotfiles.stdout | match("added|updated")
      failed_when: update_dotfiles.rc > 1

    - name: Run bin/homedir-setup
      shell: bin/homedir-setup
      args:
        chdir: "~"
      register: homedir_setup
      changed_when: homedir_setup.stdout | match("Updating|Cloning")
      failed_when: homedir_setup.rc != 0

mercurial