--- - name: Ensure tmux is installed package: name: tmux state: present - name: Copy tmux config with mouse support copy: src: tmux.conf dest: "/etc/tmux.conf" owner: "{{ ansible_user }}" mode: "0644" - name: Ensure tmux is used as default shell ansible.builtin.blockinfile: path: /root/.bashrc block: | case $- in *i*) if command -v tmux &>/dev/null; then if [ -z "$TMUX" ]; then tmux attach-session -t default || tmux new-session -s default fi fi ;; esac marker: "# {mark} ANSIBLE TMUX CONFIG"