2020-08-18 11:57:53 +02:00
|
|
|
- name: install tmux packages
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.apt:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- tmux
|
|
|
|
state: present
|
|
|
|
cache_valid_time: 360
|
|
|
|
|
|
|
|
# - name: ensure homedir exists
|
|
|
|
# become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
# ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
# path: " {{ tmux_conf_destination }}"
|
|
|
|
# state: directory
|
|
|
|
|
|
|
|
# - name: copy .tmux.conf
|
|
|
|
# become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
# ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
# src: ".tmux.conf"
|
|
|
|
# dest: "{{ tmux_conf_destination }}"
|
|
|
|
# backup: true
|
|
|
|
|
|
|
|
- name: add tmux-session config to .bashrc
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.blockinfile:
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|