diff --git a/system/base/user/meta/argument_specs.yml b/system/base/user/meta/argument_specs.yml new file mode 100644 index 0000000..5ac99cc --- /dev/null +++ b/system/base/user/meta/argument_specs.yml @@ -0,0 +1,7 @@ +--- +argument_specs: + main: + options: + system_base_user_become_user: + type: "str" + required: true diff --git a/system/base/user/tasks/main.yml b/system/base/user/tasks/main.yml index d857c1a..b04db5c 100644 --- a/system/base/user/tasks/main.yml +++ b/system/base/user/tasks/main.yml @@ -1,23 +1,31 @@ --- +- name: "get user home directory" + ansible.builtin.getent: + database: "passwd" + key: "{{ system_base_user_become_user }}" + - block: - name: "clone tmux dotfiles" ansible.builtin.git: repo: "https://git.wojciechkozlowski.eu/config/tmux.git" - dest: ".tmux" + dest: "{{ system_base_user_become_user_home_directory }}/.tmux" recursive: true # On first tmux launch install plugins with - name: "configure tmux" ansible.builtin.copy: src: "./tmux.conf" - dest: ".tmux.conf" + dest: "{{ system_base_user_become_user_home_directory }}/.tmux.conf" mode: 0644 - name: "configure bashrc" ansible.builtin.copy: src: "./bashrc" - dest: ".bashrc" + dest: "{{ system_base_user_become_user_home_directory }}/.bashrc" mode: 0644 - become: false + become_user: "{{ system_base_user_become_user }}" + vars: + system_base_user_become_user_home_directory: "\ + {{ getent_passwd[system_base_user_become_user].4 }}"