This commit is contained in:
2022-02-28 16:15:45 +01:00
parent 4d0d3b0d69
commit 3699bcc0e1
7 changed files with 261 additions and 7 deletions

View File

@ -48,6 +48,25 @@
- samba-user
- system-user
- name: (samba_user.yml) Ensure samba users exists with given group membership
user:
name: '{{ item.name }}'
state: present
uid: '{{ item.user_id | default(omit) }}'
#group: '{{ item.0.name | default(omit) }}'
groups: "{{ item.groups|join(', ') }}"
password: "{{ item.password | password_hash('sha512') }}"
update_password: on_create
append: yes
loop: "{{ samba_user }}"
loop_control:
label: '{{ item.name }}'
tags:
- samba-server
- samba-user
- system-user
- name: (samba-user.yml) Check if samba user exists
shell: pdbedit -w -L | awk -F":" '{ print $1 }' | grep '{{ item.name }}'