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

46 lines
1.3 KiB
YAML

---
# Common/Usersetup: Auto-setup a user shell and prepare dotfiles - FreeBSD 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:
- common_usersetup.stat.exists == false and usersetup_chsh == true
become: true
ansible.builtin.user:
name: "{{ ansible_user_id }}"
shell: /usr/local/bin/zsh
# - name: Usersetup - Install locales package
# become: true
# ansible.builtin.apt:
# name: locales
# state: present
# diff: false
# - name: Usersetup - Setup locale en_US
# when:
# - common_usersetup.stat.exists == false
# become: true
# ansible.builtin.locale_gen:
# name: en_US.UTF-8
# state: present
# - name: Usersetup - Setup locale de_DE
# when:
# - common_usersetup.stat.exists == false
# become: true
# ansible.builtin.locale_gen:
# name: de_DE.UTF-8
# state: present
- name: Usersetup - Create lockfile
when:
- common_usersetup.stat.exists == false
ansible.builtin.file:
path: "{{ ansible_user_dir }}/.ansbl-common-usersetup"
state: touch