ansible-role-common/tasks/usersetup-FreeBSD.yml
Jannik Beyerstedt a8285962a9 [TIDY] move when statements, fix whitespace
Having the when condition of a task at the top instead of bottom is
easiert to read. Also some spaces were another whitespace character on
accident.
2022-02-13 20:52:22 +01:00

45 lines
1.2 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: .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: yes
ansible.builtin.user:
name: "{{ ansible_user_id }}"
shell: /usr/local/bin/zsh
# - name: usersetup - Install locales package
# become: yes
# ansible.builtin.apt:
# name: locales
# state: present
# - name: usersetup - Setup locale en_US
# when:
# - common_usersetup.stat.exists == false
# become: yes
# ansible.builtin.locale_gen:
# name: en_US.UTF-8
# state: present
# - name: usersetup - Setup locale de_DE
# when:
# - common_usersetup.stat.exists == false
# become: yes
# 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: .ansbl-common-usersetup
state: touch