46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
|
---
|
||
|
# Common/Usersetup: Auto-setup a user shell and prepare dotfiles - CentOS Version
|
||
|
# Will run once per user, because of lockfile `~/.ansbl-common-usersetup`
|
||
|
|
||
|
- name: usersetup - Check, if usersetup already ran
|
||
|
stat:
|
||
|
path: .ansbl-common-usersetup
|
||
|
register: common_usersetup
|
||
|
|
||
|
- name: usersetup - Change login shell to zsh for current user
|
||
|
become: yes
|
||
|
user:
|
||
|
name: "{{ ansible_user_id }}"
|
||
|
shell: /bin/zsh
|
||
|
when:
|
||
|
- common_usersetup.stat.exists == false and usersetup_chsh == true
|
||
|
|
||
|
# TODO: adapt to CentOS/ RHEL systems, if needed
|
||
|
# - name: usersetup - Install locales package
|
||
|
# become: yes
|
||
|
# apt:
|
||
|
# name: locales
|
||
|
# state: present
|
||
|
|
||
|
# - name: usersetup - Setup locale en_US
|
||
|
# become: yes
|
||
|
# locale_gen:
|
||
|
# name: en_US.UTF-8
|
||
|
# state: present
|
||
|
# when:
|
||
|
# - common_usersetup.stat.exists == false
|
||
|
# - name: usersetup - Setup locale de_DE
|
||
|
# become: yes
|
||
|
# locale_gen:
|
||
|
# name: de_DE.UTF-8
|
||
|
# state: present
|
||
|
# when:
|
||
|
# - common_usersetup.stat.exists == false
|
||
|
|
||
|
- name: usersetup - Create lockfile
|
||
|
file:
|
||
|
path: .ansbl-common-usersetup
|
||
|
state: touch
|
||
|
when:
|
||
|
- common_usersetup.stat.exists == false
|