2019-10-06 20:41:31 +00:00
|
|
|
---
|
|
|
|
# Common/Usersetup: Auto-setup a user shell and prepare dotfiles - macOS Version
|
|
|
|
# Will run once per user, because of lockfile `~/.ansbl-common-usersetup`
|
|
|
|
|
|
|
|
- name: usersetup - Check, if usersetup already ran
|
|
|
|
stat:
|
|
|
|
path: .ansbl-common-usersetup
|
2019-11-12 20:42:58 +00:00
|
|
|
register: common_usersetup
|
2019-10-06 20:41:31 +00:00
|
|
|
|
|
|
|
- name: usersetup - Change login shell to zsh for current user
|
|
|
|
become: yes
|
|
|
|
user:
|
|
|
|
name: "{{ ansible_user_id }}"
|
|
|
|
shell: /bin/zsh
|
|
|
|
when:
|
2019-10-14 06:00:17 +00:00
|
|
|
- common_usersetup.stat.exists == false and usersetup_chsh == true
|
2019-10-06 20:41:31 +00:00
|
|
|
|
|
|
|
- name: usersetup - Create lockfile
|
|
|
|
file:
|
|
|
|
path: .ansbl-common-usersetup
|
|
|
|
state: touch
|
|
|
|
when:
|
|
|
|
- common_usersetup.stat.exists == false
|