From 4e22d06883f303f11b14d2797f3b57b9e8c5fb6c Mon Sep 17 00:00:00 2001 From: L3D Date: Tue, 12 Apr 2022 00:23:15 +0200 Subject: [PATCH] Add tmux option --- defaults/main.yml | 3 +++ tasks/main.yml | 4 ++++ tasks/tmux.yml | 23 +++++++++++++++++++++++ templates/tmux.conf.j2 | 2 ++ vars/main.yml | 2 +- 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tasks/tmux.yml create mode 100644 templates/tmux.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index f486eb2..d6d5e65 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,5 +54,8 @@ dotfiles__custom_config: [] # show hidden files in ranger dotfiles__ranger_hidden_files: true +# configure tmux +dotfiles__modify_tmux: true + accounts: - "{{ ansible_user_id }}" diff --git a/tasks/main.yml b/tasks/main.yml index 68af83e..0be4f66 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -18,3 +18,7 @@ - name: deploy ranger config ansible.builtin.include_tasks: ranger.yml + +- name: deploy .tmux.conf + ansible.builtin.include_tasks: tmux.yml + when: dotfiles__modify_tmux | bool diff --git a/tasks/tmux.yml b/tasks/tmux.yml new file mode 100644 index 0000000..363292b --- /dev/null +++ b/tasks/tmux.yml @@ -0,0 +1,23 @@ +--- +- name: Copy vimrc configuration to root + become: true + ansible.builtin.copy: + src: 'templates/tmux.conf.j2' + dest: '/root/.tmux.conf' + owner: root + group: root + mode: 'u=rw,g=r,o=' + +- name: Copy vimrc configuration to non admin users + become: true + ansible.builtin.copy: + src: 'templates/tmux.conf.j2' + dest: '/home/{{ item }}/.tmux.conf' + owner: '{{ item }}' + group: '{{ item }}' + mode: 'u=rw,g=r,o=' + with_items: "{{ accounts }}" + when: + - accounts is defined + - accounts != ['root'] + - accounts != 'root' diff --git a/templates/tmux.conf.j2 b/templates/tmux.conf.j2 new file mode 100644 index 0000000..334c1da --- /dev/null +++ b/templates/tmux.conf.j2 @@ -0,0 +1,2 @@ + +set -g history-limit 65536 diff --git a/vars/main.yml b/vars/main.yml index 2228fe4..0477281 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 2074 # should be increased integer +playbook_version_number: 2075 # should be increased integer playbook_version_path: 'role_dotfiles_chaos-bodensee_github.version'