ansible-roles/system/base/user/tasks/main.yml

34 lines
997 B
YAML
Raw Normal View History

2022-12-20 19:47:11 +01:00
---
- name: "get user home directory"
ansible.builtin.getent:
database: "passwd"
key: "{{ system_base_user_become_user }}"
2022-12-20 19:47:11 +01:00
- block:
- name: "clone tmux dotfiles"
ansible.builtin.git:
2023-08-16 23:16:53 +02:00
repo: "https://git.thenineworlds.net/config/tmux.git"
dest: "{{ system_base_user_become_user_home_directory }}/.tmux"
2022-12-20 19:47:11 +01:00
recursive: true
2023-07-22 23:50:58 +02:00
ignore_errors: true
2022-12-20 19:47:11 +01:00
# On first tmux launch install plugins with <Ctrl + a + I>
- name: "configure tmux"
ansible.builtin.copy:
src: "./tmux.conf"
dest: "{{ system_base_user_become_user_home_directory }}/.tmux.conf"
2022-12-20 19:47:11 +01:00
mode: 0644
- name: "configure bashrc"
ansible.builtin.copy:
src: "./bashrc"
dest: "{{ system_base_user_become_user_home_directory }}/.bashrc"
2022-12-20 19:47:11 +01:00
mode: 0644
2023-11-04 16:49:59 +01:00
become: true
become_user: "{{ system_base_user_become_user }}"
vars:
system_base_user_become_user_home_directory: "\
{{ getent_passwd[system_base_user_become_user].4 }}"