samba_packages: pkg.installed: - pkgs: - samba - samba-common-bin smbd: service.running: - enable: True - watch: - file: /etc/samba/smb.conf - pkg: samba_packages /etc/samba/smb.conf: file.managed: - source: 'salt://samba/files/smb.conf.jinja' - template: jinja {# generate these with print(hashlib.new('md4', "password".encode('utf-16le')).hexdigest()) #} {% for user, passw in salt.pillar.get('samba:users', {}).items() %} samba_{{user}}: pdbedit.managed: - name: {{user}} - password: {{passw}} - password_hashed: True {% endfor %} include: - samba.wsdd