ansible-tmux/tasks/main.yml
2026-06-13 18:20:40 +02:00

31 lines
677 B
YAML

---
- 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: Auto-start tmux for interactive shells
ansible.builtin.blockinfile:
path: "{{ item }}"
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"
loop:
- /root/.bashrc
- /root/.zshrc