From 16d26c6bf021074ec49dc0d60f8feb5f7c1c3296 Mon Sep 17 00:00:00 2001 From: Quotengrote <38253905+quotengrote@users.noreply.github.com> Date: Wed, 2 Dec 2020 14:38:06 +0100 Subject: [PATCH] bashrc wird nur noch getouched wenn sie nicht existiert (#79) --- roles/mgrote.tmux/tasks/main.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/roles/mgrote.tmux/tasks/main.yml b/roles/mgrote.tmux/tasks/main.yml index c95b9cc9..bf572519 100644 --- a/roles/mgrote.tmux/tasks/main.yml +++ b/roles/mgrote.tmux/tasks/main.yml @@ -6,24 +6,17 @@ state: present cache_valid_time: 360 - - name: touch "{{ tmux_bashrc_destination }}" + - name: Check if "{{ tmux_bashrc_destination }}" exists + stat: + path: "{{ tmux_bashrc_destination }}" + register: stat_result + + - name: touch "{{ tmux_bashrc_destination }}" , if it doesnt exist already become: yes file: path: "{{ tmux_bashrc_destination }}" state: touch - -# - name: ensure homedir exists -# become: yes -# ansible.builtin.file: -# path: " {{ tmux_conf_destination }}" -# state: directory - -# - name: copy .tmux.conf -# become: yes -# ansible.builtin.template: -# src: ".tmux.conf" -# dest: "{{ tmux_conf_destination }}" -# backup: true + when: not stat_result.stat.exists - name: add tmux-session config to .bashrc become: yes