Despite the fact @insideClaw answer is the best practice, I want show how you can achieve that by modify the "/etc/passwd" file; which contain the shell of all users.
- name: Change the default shell to ZSH
ansible.builtin.shell: |
OLD_LINE_PASSWD=$(grep "$USER" /etc/passwd)
NEW_LINE_PASSWD=$(echo $OLD_LINE_PASSWD | sed "s|$SHELL|/usr/bin/zsh|")
sudo sed -i "s|$OLD_LINE_PASSWD|$NEW_LINE_PASSWD|" /etc/passwd
become_user: "{{ ansible_user }}"