fix: copy only missing skel files
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
df6d4d206e
commit
0674c7d13e
17
tasks/copy_skel_file.yml
Normal file
17
tasks/copy_skel_file.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- 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"
|
@ -75,14 +75,14 @@
|
|||||||
when: unix_user.value.btrfs is defined and
|
when: unix_user.value.btrfs is defined and
|
||||||
unix_user.value.btrfs
|
unix_user.value.btrfs
|
||||||
block:
|
block:
|
||||||
- name: "Copy skel dir"
|
- name: "Copy skel files"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.include_tasks: copy_skel_file.yml
|
||||||
src: /etc/skel/
|
loop_control:
|
||||||
dest: "{{ user_user_home }}"
|
loop_var: skel_file
|
||||||
remote_src: true
|
with_items:
|
||||||
owner: "{{ unix_user.key }}"
|
- ".bash_logout"
|
||||||
group: "{{ unix_user.value.group | default('users') }}"
|
- ".bash_profile"
|
||||||
mode: "0644"
|
- ".bashrc"
|
||||||
- name: "Change permission unix users home dir: {{ unix_user.key }}"
|
- name: "Change permission unix users home dir: {{ unix_user.key }}"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ user_user_home }}"
|
path: "{{ user_user_home }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user