From adec8a68420c2e25f969c4d641e558670ec7cddc Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Fri, 12 Sep 2025 20:35:52 +0200 Subject: [PATCH] Initial commit --- README.md | 13 +++++++++++++ tasks/files/tmux.conf | 2 ++ tasks/main.yml | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 README.md create mode 100644 tasks/files/tmux.conf create mode 100644 tasks/main.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..188df42 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Tmux role for Ansible + +Sets tmux as the default shell and enables mouse support + +# Installation: + +Add this to requirements.yml: + +``` +- src: git+http://git.internet-czas-dzialac.pl/icd/ansible-tmux.git + version: main + name: nginx +``` diff --git a/tasks/files/tmux.conf b/tasks/files/tmux.conf new file mode 100644 index 0000000..2b90037 --- /dev/null +++ b/tasks/files/tmux.conf @@ -0,0 +1,2 @@ +# Enable mouse support +set -g mouse on \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..55cdf90 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,17 @@ +--- +- 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: Use tmux as default shell + ansible.builtin.lineinfile: + path: /root/.bashrc + line: 'case $- in *i*) [ -z "$TMUX" ] && exec tmux;; esac'