diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml index 775181d..035ca10 100644 --- a/roles/user/tasks/main.yml +++ b/roles/user/tasks/main.yml @@ -38,40 +38,37 @@ - name: Check for dotfile initialization stat: path=$HOME/.dotfiles register: p - - name: Configure git SSH substitute for GitHub - git_config: - name: url."https://github.com/".insteadOf - value: "git@github.com:" - scope: global - when: not p.stat.exists - - name: Configure git SSH substitute for GitLab - git_config: - name: url."https://gitlab.com/".insteadOf - value: "git@gitlab.com:" - scope: global - when: not p.stat.exists - - name: Clone bootstrap script - git: - accept_hostkey: yes - repo: git@gitlab.com:rehashedsalt/bootstrap - dest: $HOME/bootstrap - depth: 1 - force: yes - when: not p.stat.exists - - name: Execute bootstrap script - shell: cd && ~/bootstrap/build-home.sh - when: not p.stat.exists - - name: Disable untracked files on dotfiles - git_config: - name: status.showUntrackedFiles - value: "no" - scope: local - repo: ~/.dotfiles - when: not p.stat.exists - - name: Remove bootstrap script directory - file: - path: ~/bootstrap - state: absent + - name: Initialize dotfiles + block: + - name: Configure git SSH substitute for GitHub + git_config: + name: url."https://github.com/".insteadOf + value: "git@github.com:" + scope: global + - name: Configure git SSH substitute for GitLab + git_config: + name: url."https://gitlab.com/".insteadOf + value: "git@gitlab.com:" + scope: global + - name: Clone bootstrap script + git: + accept_hostkey: yes + repo: git@gitlab.com:rehashedsalt/bootstrap + dest: $HOME/bootstrap + depth: 1 + force: yes + - name: Execute bootstrap script + shell: cd && ~/bootstrap/build-home.sh + - name: Disable untracked files on dotfiles + git_config: + name: status.showUntrackedFiles + value: "no" + scope: local + repo: ~/.dotfiles + - name: Remove bootstrap script directory + file: + path: ~/bootstrap + state: absent when: not p.stat.exists become: yes become_user: salt