ansible-role-unix-users/tasks/copy_skel_file.yml
Markus Pesch 0674c7d13e
All checks were successful
continuous-integration/drone/push Build is passing
fix: copy only missing skel files
2023-12-23 17:38:08 +01:00

18 lines
501 B
YAML

---
- name: "Exist file {{ skel_file }}"
ansible.builtin.stat:
path: "{{ user_user_home }}/{{ skel_file }}"
register: _skel_file
- name: Copy skel file
when: _skel_file.stat is defined and
_skel_file.stat.exist is defined and
not _skel_file.stat.exist
ansible.builtin.copy:
src: "/etc/skel/{{ _skel_file }}"
dest: "{{ user_user_home }}/{{ skel_file }}"
owner: "{{ unix_user.key }}"
group: "{{ unix_user.value.group | default('users') }}"
mode: "0600"