--- - name: Update apt cache become: true ansible.builtin.apt: update_cache: true when: - ansible_pkg_mgr == "apt" - name: Install redis backend become: true ansible.builtin.apt: name: 'redis' state: 'present'