# HG changeset patch # User Meredith Howard # Date 1497573804 14400 # Node ID 292cb125556d17d93e0653bf477436a287591757 # Parent 539425ad28ce44d13d4dcb835e9989ab257411e0 fix become setup diff --git a/local.yml b/local.yml --- a/local.yml +++ b/local.yml @@ -1,7 +1,6 @@ --- - name: Devbox Setup hosts: all - become: yes roles: - devbox - user diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml --- a/roles/user/tasks/main.yml +++ b/roles/user/tasks/main.yml @@ -20,21 +20,23 @@ tags: user, ssh - name: Clone dotfiles - become: "{{user_name}}" + become: true + become_user: "{{user_name}}" shell: > hg clone -U {{dotfiles_default | quote}} _dotfiles_ && mv _dotfiles_/.hg . && rmdir _dotfiles_ && hg -R ~ update -C master args: - chdir: "~" - creates: "~/.hg" + chdir: "{{user.home}}" + creates: "{{user.home}}/.hg" tags: user, dotfiles - name: Assert hg sources - become: "{{user_name}}" + become: true + become_user: "{{user_name}}" ini_file: - dest: "~/.hg/hgrc" + dest: "{{user.home}}/.hg/hgrc" section: paths option: "{{item.name}}" value: "{{item.url}}" @@ -46,20 +48,22 @@ tags: user, dotfiles - name: Update dotfiles - become: "{{user_name}}" + become: true + become_user: "{{user_name}}" command: hg pull -u args: - chdir: "~" + chdir: "{{user.home}}" register: update_dotfiles changed_when: update_dotfiles.stdout | match("added|updated") failed_when: update_dotfiles.rc > 1 tags: user, dotfiles - name: Run bin/homedir-setup - become: "{{user_name}}" + become: true + become_user: "{{user_name}}" shell: bin/homedir-setup args: - chdir: "~" + chdir: "{{user.home}}" register: homedir_setup changed_when: homedir_setup.stdout | match("Updating|Cloning") failed_when: homedir_setup.rc != 0