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