--- - name: Update apt cache apt: update_cache: true cache_valid_time: 3600 become: true - name: Install Common packages apt: name: "{{ common_packages }}" state: present become: true - name: Set zsh as the default shell shell: chsh -s $(which zsh) {{ ansible_user }} become: true when: ansible_user != "root" register: chsh_result failed_when: chsh_result.rc != 0 changed_when: false