paulbsd-salt/states/samba/users.sls

19 lines
424 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "samba/map.jinja" import samba with context %}
{%- from "samba/map.jinja" import users with context %}
2022-10-10 10:17:01 +02:00
{%- for name, user in users.items() %}
samba-user-{{ name }}:
2020-07-10 00:58:55 +02:00
{%- if user.enabled %}
pdbedit.managed:
2022-10-10 10:17:01 +02:00
- name: {{ name }}
- login: {{ name }}
2020-07-10 00:58:55 +02:00
- password: "{{ user.password }}"
2022-01-10 17:57:40 +01:00
{%- else %}
pdbedit.absent:
2022-10-10 10:17:01 +02:00
- name: {{ name }}
2022-01-10 17:57:40 +01:00
{%- endif %}
2020-07-10 00:58:55 +02:00
- require:
- pkg: samba-pkg
2021-08-19 21:15:24 +02:00
{%- endfor %}