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

24 lines
748 B
YAML
Raw Normal View History

---
# 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"
2019-11-12 20:42:58 +00:00
register: common_usersetup
- name: usersetup - Change login shell to zsh for current user
when:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: yes
ansible.builtin.user:
name: "{{ ansible_user_id }}"
shell: /bin/zsh
- name: usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file:
path: "{{ ansible_user_dir }}/.ansbl-common-usersetup"
state: touch