paulbsd-salt/states/samba/users.sls
2022-10-10 10:17:01 +02:00

19 lines
424 B
Plaintext

---
{%- from "samba/map.jinja" import samba with context %}
{%- from "samba/map.jinja" import users with context %}
{%- for name, user in users.items() %}
samba-user-{{ name }}:
{%- if user.enabled %}
pdbedit.managed:
- name: {{ name }}
- login: {{ name }}
- password: "{{ user.password }}"
{%- else %}
pdbedit.absent:
- name: {{ name }}
{%- endif %}
- require:
- pkg: samba-pkg
{%- endfor %}