ansible-role-git/tasks/git_user.yml

29 lines
689 B
YAML
Raw Normal View History

2022-04-11 11:04:14 +00:00
---
- name: Get entity for user {{ item.key }}
getent:
database: passwd
key: "{{ item.key }}"
- name: Create git config directory for {{ item.key }}
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
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