homeserver/roles/mgrote.tmux/tasks/main.yml
mg a0b88b4aee bugs_laptop (#136)
Merge branch 'master' into bugs_laptop

vars

polybar tools

tmux become true

doku

xnview

package feh

vars

playbook sources

taks linux mint

polybar

vivaldi

alacritty

siji

ufw

apt sources nicht bei irantu

ripgrep

siji bug

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#136
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
2021-06-29 13:58:31 +02:00

30 lines
848 B
YAML

---
- name: install tmux packages
become: yes
ansible.builtin.package:
name:
- tmux
state: present
cache_valid_time: 360
- name: Check if "{{ tmux_bashrc_destination }}" exists
become: yes
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
when: not stat_result.stat.exists
- name: add tmux-session config to .bashrc
become: yes
ansible.builtin.blockinfile:
path: "{{ tmux_bashrc_destination }}"
block: |
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
tmux attach -t {{ tmux_standardsession_name }} || tmux new -s {{ tmux_standardsession_name }}
fi