ansible-role-git/tasks/git_user.yml

29 lines
777 B
YAML
Raw Normal View History

2022-04-11 11:04:14 +00:00
---
- name: "Determine entries via NSS for unix user: {{ item.key }}"
ansible.builtin.getent:
2022-04-11 11:04:14 +00:00
database: passwd
key: "{{ item.key }}"
- name: "Create git config directory for unix user: {{ item.key }}"
2023-02-08 17:23:05 +00:00
ansible.builtin.file:
2022-04-11 11:04:14 +00:00
dest: "{{ getent_passwd[item.key][4] }}/.config/git"
owner: "{{ item.key }}"
group: "{{ getent_passwd[item.key][2] }}"
state: directory
2023-02-26 21:23:06 +00:00
mode: "0755"
2022-04-11 11:04:14 +00:00
- name: Create global git config files
2023-02-08 17:23:05 +00:00
ansible.builtin.template:
2022-04-11 11:04:14 +00:00
src: "{{ filename }}.j2"
dest: "{{ getent_passwd[item.key][4] }}/{{ filename }}"
owner: "{{ item.key }}"
group: "{{ getent_passwd[item.key][2] }}"
2023-02-26 21:23:06 +00:00
mode: "0644"
2022-04-11 11:04:14 +00:00
with_items:
- .config/git/config
- .config/git/message
- .config/git/ignore
loop_control:
loop_var: filename