ansible-role-common/tasks/usersetup-Darwin.yml

24 lines
698 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: .ansbl-common-usersetup
register: common_usersetup
- name: usersetup - Change login shell to zsh for current user
become: yes
ansible.builtin.user:
name: "{{ ansible_user_id }}"
shell: /bin/zsh
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
- name: usersetup - Create lockfile
ansible.builtin.file:
path: .ansbl-common-usersetup
state: touch
when:
- common_usersetup.stat.exists == false