From c46d214037e486ec5dda670daf550f53d37a76a1 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Fri, 17 Oct 2025 21:12:48 +0200 Subject: [PATCH] Fix tmux config being added multiple times --- tasks/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index dc6c23d..34be836 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,10 +11,10 @@ owner: "{{ ansible_user }}" mode: "0644" -- name: Use tmux as default shell and attach to existing session - ansible.builtin.lineinfile: +- name: Ensure tmux is used as default shell + ansible.builtin.blockinfile: path: /root/.bashrc - line: | + block: | case $- in *i*) if command -v tmux &>/dev/null; then @@ -24,3 +24,4 @@ fi ;; esac + marker: "# {mark} ANSIBLE TMUX CONFIG"