40 with_file: |
40 with_file: |
41 - public_keys/{{user.name}} |
41 - public_keys/{{user.name}} |
42 tags: user, ssh |
42 tags: user, ssh |
43 |
43 |
44 - name: ssh | Ensure known_hosts keys |
44 - name: ssh | Ensure known_hosts keys |
45 sudo: true |
45 become: true |
46 sudo_user: "{{user.name}}" |
46 become_user: "{{user.name}}" |
47 lineinfile: |
47 lineinfile: |
48 dest: "{{user.home}}/.ssh/known_hosts" |
48 dest: "{{user.home}}/.ssh/known_hosts" |
49 state: present |
49 state: present |
50 line: "{{item.value}}" |
50 line: "{{item.value}}" |
51 create: true |
51 create: true |
52 mode: 0600 |
52 mode: 0600 |
53 with_dict: hostkeys |
53 with_dict: hostkeys |
54 tags: user, ssh |
54 tags: user, ssh |
55 |
55 |
56 - name: ssh | Purge invalid known_hosts keys |
56 - name: ssh | Purge invalid known_hosts keys |
57 sudo: true |
57 become: true |
58 sudo_user: "{{user.name}}" |
58 become_user: "{{user.name}}" |
59 lineinfile: |
59 lineinfile: |
60 dest: "{{user.home}}/.ssh/known_hosts" |
60 dest: "{{user.home}}/.ssh/known_hosts" |
61 state: absent |
61 state: absent |
62 line: "{{item.value}}" |
62 line: "{{item.value}}" |
63 with_dict: hostkeys_removed |
63 with_dict: hostkeys_removed |
81 && chown -R {{user.name}}:{{user.group}} {{user.home}}/.hg |
81 && chown -R {{user.name}}:{{user.group}} {{user.home}}/.hg |
82 && sudo -u {{user.name}} hg -R {{user.home}} update -C |
82 && sudo -u {{user.name}} hg -R {{user.home}} update -C |
83 tags: user, dotfiles |
83 tags: user, dotfiles |
84 |
84 |
85 |
85 |
86 # This is an existing script that clones/updates oh-my-zsh, rbenv, and plenv. |
86 # This is an existing script that clones/updates zgen, rbenv, and plenv. |
87 # My dotfiles use each if the right directory exists. |
87 # My dotfiles use each if the right directory exists. |
88 - name: Run homedir-setup |
88 - name: Run homedir-setup |
89 sudo: true |
89 become: true |
90 sudo_user: "{{user.name}}" |
90 become_user: "{{user.name}}" |
91 shell: bin/homedir-setup chdir={{user.home}} |
91 shell: bin/homedir-setup chdir={{user.home}} |
92 register: homedir_setup |
92 register: homedir_setup |
93 changed_when: homedir_setup.stdout | match("Updating|Cloning") |
93 changed_when: homedir_setup.stdout | match("Updating|Cloning") |
94 failed_when: homedir_setup.rc != 0 |
94 failed_when: homedir_setup.rc != 0 |
95 tags: user, install |
95 tags: user, install |