set user shell with Ansible
This commit is contained in:
parent
39ae4ebef2
commit
b2a77c972e
2 changed files with 3 additions and 10 deletions
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
LOGINSHELL=`getent passwd $USER | cut -d: -f7`
|
|
||||||
echo \"${LOGINSHELL}\"
|
|
|
@ -14,10 +14,8 @@
|
||||||
- make
|
- make
|
||||||
- keepassxc
|
- keepassxc
|
||||||
- zsh
|
- zsh
|
||||||
- name: Check login shell
|
|
||||||
setup:
|
|
||||||
fact_path: "{{ role_path }}/facts"
|
|
||||||
- name: Set default shell to zsh
|
- name: Set default shell to zsh
|
||||||
become: true
|
become: true
|
||||||
shell: usermod -s $(which zsh) {{ ansible_user_id }}
|
user:
|
||||||
when: ansible_facts.ansible_local.login_shell.find('zsh') == -1
|
name: "{{ ansible_user_id }}"
|
||||||
|
shell: /usr/bin/zsh
|
||||||
|
|
Reference in a new issue