40 state: present |
43 state: present |
41 line: "{{item.value}}" |
44 line: "{{item.value}}" |
42 create: true |
45 create: true |
43 mode: 0600 |
46 mode: 0600 |
44 with_dict: hostkeys |
47 with_dict: hostkeys |
|
48 tags: user, ssh |
45 |
49 |
46 - name: ssh | Purge invalid known_hosts keys |
50 - name: ssh | Purge invalid known_hosts keys |
47 sudo: true |
51 sudo: true |
48 sudo_user: "{{user.name}}" |
52 sudo_user: "{{user.name}}" |
49 lineinfile: |
53 lineinfile: |
50 dest: "{{user.home}}/.ssh/known_hosts" |
54 dest: "{{user.home}}/.ssh/known_hosts" |
51 state: absent |
55 state: absent |
52 line: "{{item.value}}" |
56 line: "{{item.value}}" |
53 with_dict: hostkeys_removed |
57 with_dict: hostkeys_removed |
|
58 tags: user, ssh |
54 |
59 |
55 |
60 |
56 # I like to make my ~ my dotfiles working directory (some folks symlink |
61 # I like to make my ~ my dotfiles working directory (some folks symlink |
57 # everything) Here that means I clone, move hg, then checkout, clobbering any |
62 # everything) Here that means I clone, move hg, then checkout, clobbering any |
58 # conflicts with /etc/skel stuff. |
63 # conflicts with /etc/skel stuff. |
59 - name: Check for dotfiles checkout in homedir |
64 - name: Check for dotfiles checkout in homedir |
60 stat: path={{user.home}}/.hg |
65 stat: path={{user.home}}/.hg |
61 register: dotfiles |
66 register: dotfiles |
|
67 tags: user, dotfiles |
62 |
68 |
63 - name: Clone dotfiles |
69 - name: Clone dotfiles |
64 when: dotfiles.stat.exists == false |
70 when: dotfiles.stat.exists == false |
65 shell: > |
71 shell: > |
66 hg clone -U {{dotfiles_repository}} {{user.home}}/_dotfiles_ |
72 hg clone -U {{dotfiles_repository}} {{user.home}}/_dotfiles_ |
67 && mv {{user.home}}/_dotfiles_/.hg {{user.home}} |
73 && mv {{user.home}}/_dotfiles_/.hg {{user.home}} |
68 && rmdir {{user.home}}/_dotfiles_ |
74 && rmdir {{user.home}}/_dotfiles_ |
69 && chown -R {{user.name}}:{{user.group}} {{user.home}}/.hg |
75 && chown -R {{user.name}}:{{user.group}} {{user.home}}/.hg |
70 && sudo -u {{user.name}} hg -R {{user.home}} update -C |
76 && sudo -u {{user.name}} hg -R {{user.home}} update -C |
|
77 tags: user, dotfiles |
71 |
78 |
72 |
79 |
73 # This is an existing script that clones/updates oh-my-zsh, rbenv, and plenv. |
80 # This is an existing script that clones/updates oh-my-zsh, rbenv, and plenv. |
74 # My dotfiles use each if the right directory exists. |
81 # My dotfiles use each if the right directory exists. |
75 - name: Run homedir-setup |
82 - name: Run homedir-setup |
77 sudo_user: "{{user.name}}" |
84 sudo_user: "{{user.name}}" |
78 shell: ./.homedir-setup.rb -su chdir={{user.home}} |
85 shell: ./.homedir-setup.rb -su chdir={{user.home}} |
79 register: homedir_setup |
86 register: homedir_setup |
80 changed_when: homedir_setup.stdout | match("Updating|Installing") |
87 changed_when: homedir_setup.stdout | match("Updating|Installing") |
81 failed_when: homedir_setup.rc != 0 |
88 failed_when: homedir_setup.rc != 0 |
|
89 tags: user, install |
82 |
90 |
83 |
91 |