ansible-role-git/tasks/git_user.yml
Markus Pesch b48e2a37c6
All checks were successful
continuous-integration/drone/push Build is passing
style(lint): quote mode
2023-02-26 22:23:06 +01:00

29 lines
777 B
YAML

---
- name: "Determine entries via NSS for unix user: {{ item.key }}"
ansible.builtin.getent:
database: passwd
key: "{{ item.key }}"
- name: "Create git config directory for unix user: {{ item.key }}"
ansible.builtin.file:
dest: "{{ getent_passwd[item.key][4] }}/.config/git"
owner: "{{ item.key }}"
group: "{{ getent_passwd[item.key][2] }}"
state: directory
mode: "0755"
- name: Create global git config files
ansible.builtin.template:
src: "{{ filename }}.j2"
dest: "{{ getent_passwd[item.key][4] }}/{{ filename }}"
owner: "{{ item.key }}"
group: "{{ getent_passwd[item.key][2] }}"
mode: "0644"
with_items:
- .config/git/config
- .config/git/message
- .config/git/ignore
loop_control:
loop_var: filename