split smb into a subformula
This commit is contained in:
@@ -1,29 +1,4 @@
|
|||||||
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:
|
include:
|
||||||
|
- samba.smbd
|
||||||
- samba.wsdd
|
- samba.wsdd
|
||||||
|
|
||||||
|
|||||||
27
samba/smbd.sls
Normal file
27
samba/smbd.sls
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
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
|
||||||
|
- check_cmd: /usr/bin/testparm -d 0 -s
|
||||||
|
|
||||||
|
{# 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 %}
|
||||||
Reference in New Issue
Block a user