updated samba state
This commit is contained in:
parent
0e36358ea8
commit
8be1f8d305
@ -1,6 +1,9 @@
|
|||||||
---
|
---
|
||||||
{%- from "samba/map.jinja" import samba with context %}
|
{%- from "samba/map.jinja" import samba with context %}
|
||||||
samba-config:
|
samba-config:
|
||||||
ini_manage.options_present:
|
ini.options_present:
|
||||||
- name: /etc/samba/smb.conf
|
- name: /etc/samba/smb.conf
|
||||||
- sections: {{ samba.config }}
|
- sections: {{ samba.config }}
|
||||||
|
- watch_in:
|
||||||
|
- service: samba-service-smbd
|
||||||
|
- service: samba-service-nmbd
|
||||||
|
11
states/samba/service.sls
Normal file
11
states/samba/service.sls
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
{%- from "samba/map.jinja" import samba with context %}
|
||||||
|
samba-service-smbd:
|
||||||
|
service.running:
|
||||||
|
- name: smbd
|
||||||
|
- reload: True
|
||||||
|
|
||||||
|
samba-service-nmbd:
|
||||||
|
service.running:
|
||||||
|
- name: nmbd
|
||||||
|
- restart: True
|
@ -2,16 +2,16 @@
|
|||||||
{%- from "samba/map.jinja" import samba with context %}
|
{%- from "samba/map.jinja" import samba with context %}
|
||||||
{%- from "samba/map.jinja" import users with context %}
|
{%- from "samba/map.jinja" import users with context %}
|
||||||
|
|
||||||
{%- for user in users %}
|
{%- for name, user in users.items() %}
|
||||||
samba-user-{{ user.name }}:
|
samba-user-{{ name }}:
|
||||||
{%- if user.enabled %}
|
{%- if user.enabled %}
|
||||||
pdbedit.managed:
|
pdbedit.managed:
|
||||||
- name: {{ user.name }}
|
- name: {{ name }}
|
||||||
- login: {{ user.name }}
|
- login: {{ name }}
|
||||||
- password: "{{ user.password }}"
|
- password: "{{ user.password }}"
|
||||||
{%- else %}
|
{%- else %}
|
||||||
pdbedit.absent:
|
pdbedit.absent:
|
||||||
- name: {{ user.name }}
|
- name: {{ name }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
- require:
|
- require:
|
||||||
- pkg: samba-pkg
|
- pkg: samba-pkg
|
||||||
|
Loading…
Reference in New Issue
Block a user