The repository mixed both extensions, the molecule scenario used yml while the role itself used yaml. The yml extension is the one ansible-galaxy and molecule generate, so it is applied throughout and across the sibling roles. The include_tasks calls in tasks/main.yml and tasks/create_unix_user.yml name their target explicitly and were adjusted accordingly, otherwise the role would no longer find the included task files. Co-authored-by: Copilot <copilot@github.com>
19 lines
597 B
YAML
19 lines
597 B
YAML
---
|
|
|
|
- name: "Check if the skel file exists: /etc/skel/{{ skel_file }}"
|
|
ansible.builtin.stat:
|
|
path: "/etc/skel/{{ skel_file }}"
|
|
register: _unix_users_skel_file
|
|
|
|
# force: false keeps an already customized dotfile in the home directory untouched.
|
|
- name: "Copy skel file: {{ skel_file }}"
|
|
ansible.builtin.copy:
|
|
src: "/etc/skel/{{ skel_file }}"
|
|
dest: "{{ _unix_users_home }}/{{ skel_file }}"
|
|
remote_src: true
|
|
force: false
|
|
owner: "{{ unix_user.key }}"
|
|
group: "{{ unix_user.value.group | default('users') }}"
|
|
mode: "0644"
|
|
when: _unix_users_skel_file.stat.exists
|