--- - name: Look for already installed kitty terminfo file stat: path: /usr/share/terminfo/x/xterm-kitty register: kitty_terminfo_file - name: 'Try to install "kitty-terminfo"' package: name: kitty-terminfo state: latest update_cache: yes ignore_errors: yes register: kitty_terminfo_installed when: kitty_terminfo_file.stat.exists == False - name: "If no kitty(-terminfo) available, install manually" include_tasks: manual.yml when: kitty_terminfo_installed is defined and kitty_terminfo_installed is failed