diff --git a/roles/system/facts/login_shell.fact b/roles/system/facts/login_shell.fact deleted file mode 100755 index f6b1c73..0000000 --- a/roles/system/facts/login_shell.fact +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -euo pipefail -IFS=$'\n\t' -LOGINSHELL=`getent passwd $USER | cut -d: -f7` -echo \"${LOGINSHELL}\" diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index eaf646a..5931e8e 100644 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -14,10 +14,8 @@ - make - keepassxc - zsh -- name: Check login shell - setup: - fact_path: "{{ role_path }}/facts" - name: Set default shell to zsh become: true - shell: usermod -s $(which zsh) {{ ansible_user_id }} - when: ansible_facts.ansible_local.login_shell.find('zsh') == -1 + user: + name: "{{ ansible_user_id }}" + shell: /usr/bin/zsh