This commit is contained in:
2020-10-28 02:39:46 +01:00
parent 5aaee7646b
commit ce14de76cf
24 changed files with 923 additions and 1653 deletions

View File

@ -1,58 +1,5 @@
---
# ---
# - Remove unwanted users
# ---
- name: (samba_user.yml) Check if samba user exists for removable system user
shell: pdbedit -w -L | awk -F":" '{ print $1 }' | grep '{{ item.name }}'
register: samba_remove_system_users_present
changed_when: "samba_remove_system_users_present.rc == 0"
failed_when: "samba_remove_system_users_present.rc > 1"
with_items:
- "{{ remove_system_users }}"
loop_control:
label: '{{ item.name }}'
tags:
- samba-user
- name: (samba_user.yml) Remove (old) system users from samba
shell: "smbpasswd -s -x {{ item.name }}"
with_items:
- "{{ remove_system_users }}"
loop_control:
label: '{{ item.name }}'
when: samba_remove_system_users_present is changed
tags:
- samba-user
- name: (samba_user.yml) Check if samba user exists for removable nis user
shell: pdbedit -w -L | awk -F":" '{ print $1 }' | grep '{{ item.name }}'
register: samba_remove_inis_users_present
changed_when: "samba_remove_inis_users_present.rc == 0"
failed_when: "samba_remove_inis_users_present.rc > 1"
with_items:
- "{{ remove_nis_users }}"
loop_control:
label: '{{ item.name }}'
tags:
- samba-user
- name: (samba_user.yml) Remove (old) nis users from samba
shell: "smbpasswd -s -x {{ item.name }}"
with_items:
- "{{ remove_nis_users }}"
loop_control:
label: '{{ item.name }}'
when: samba_remove_inis_users_present is changed
tags:
- samba-user
# ---
# - default user/groups
# ---