25 lines
748 B
YAML
25 lines
748 B
YAML
---
|
|
# 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
|
|
ansible.builtin.stat:
|
|
path: "{{ ansible_user_dir }}/.ansbl-common-usersetup"
|
|
register: common_usersetup
|
|
|
|
- name: Usersetup - Change login shell to zsh for current user
|
|
when:
|
|
- not common_usersetup.stat.exists and usersetup_chsh
|
|
become: true
|
|
ansible.builtin.user:
|
|
name: "{{ ansible_user_id }}"
|
|
shell: /bin/zsh
|
|
|
|
- name: Usersetup - Create lockfile
|
|
when:
|
|
- not common_usersetup.stat.exists
|
|
ansible.builtin.file:
|
|
path: "{{ ansible_user_dir }}/.ansbl-common-usersetup"
|
|
state: touch
|
|
mode: "0644"
|