roles/user/tasks/main.yml

changeset 50
8be666ca059e
parent 36
745c6a77bf68
child 54
2a04e6d7bfcc
equal deleted inserted replaced
49:6dbfcfdf807c 50:8be666ca059e
17 key: "{{item}}" 17 key: "{{item}}"
18 with_file: 18 with_file:
19 - public_keys/{{user.name}} 19 - public_keys/{{user.name}}
20 tags: user, ssh 20 tags: user, ssh
21 21
22 - name: Clone dotfiles
23 become: "{{user.name}}"
24 shell: >
25 hg clone -U {{dotfiles_repository | quote}} _dotfiles_
26 && mv _dotfiles_/.hg .
27 && rmdir _dotfiles_
28 && hg -R ~ update -C master
29 args:
30 chdir: "~"
31 creates: "~/.hg"
32
33 - name: Update dotfiles
34 become: "{{user.name}}"
35 command: hg pull -u
36 args:
37 chdir: "~"
38 register: update_dotfiles
39 changed_when: update_dotfiles.stdout | match("added|updated")
40 failed_when: update_dotfiles.rc > 1
41
42 - name: Run bin/homedir-setup
43 become: "{{user.name}}"
44 shell: bin/homedir-setup
45 args:
46 chdir: "~"
47 register: homedir_setup
48 changed_when: homedir_setup.stdout | match("Updating|Cloning")
49 failed_when: homedir_setup.rc != 0

mercurial