Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…formula

updating from upstream
  • Loading branch information
garethhowell committed Mar 20, 2020
2 parents 9fbc721 + fd2e9d7 commit 74a0699
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Available states
``samba``
---------

Installs the samba server package and service.
Installs the samba server and client packages and starts the samba service.

``samba.client``
----------------
Expand Down
15 changes: 11 additions & 4 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ samba:
role: ROLE_DOMAIN_MEMBER
conf:
render:
## List the sections your smb.conf should include
## list the sections your smb.conf should include
section_order: ['global', 'homes', 'printers', 'sharename', 'user1share']
include_unordered_sections: yes
## include sections from default.yaml (yes) or ONLY those listed above (no)
include_unordered_sections: no

sections:
global:
Expand All @@ -29,10 +30,16 @@ samba:

users:
## Optional site specific extension to smb.conf
## user.present passwd needs plaintext or hash. Hash is recommended, generate it with the following command -> openssl passwd -1
## pdbedit.managed nt needs hash. Plaintext seem to be broken (https://github.com/saltstack-formulas/samba-formula/issues/35). Generate it with the following command -> salt '*' pdbedit.generate_nt_hash PASSWORD
user1:
password: user1sambapassword
password:
passwd: $1$vFH3.Plc$7CZnr18jaLx1fMBGm1NMP/ ## Equals "user1sambapassword" in plaintext
nt: EB11C288046508EBE2AA213DB0860813 ## Equals "user1sambapassword" in plaintext
user2:
password: user2sambapassword
password:
passwd: $1$Kvm5/Q6Y$B19DYyLRCqeUsyacipVet1 ## Equals "user2sambapassword" in Plaintext
nt: 5AA13065E0B8A81835D48291E5C47236 ## Equals "user2sambapassword" in Plaintext

winbind:
krb5_default_realm: EXAMPLE.COM
2 changes: 1 addition & 1 deletion samba/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
include:
- samba.winbind-ad.clean ##because it depends on samba service
- samba.winbind.clean ##because it depends on samba service
- samba.users.clean
- samba.users.clean ##because it depends on samba service
- samba.client.clean
- samba.config.clean
- samba.server.clean
3 changes: 1 addition & 2 deletions samba/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ samba:
#### Inherit these as smb.conf defaults.
section_order: ['global', 'homes', 'printers', 'sharename',]
include_skeleton: yes
include_unordered_sections: yes
include_unordered_sections: no #best default value
sections:
global:
## samba.role: ROLE_STANDALONE (default)
Expand Down Expand Up @@ -52,7 +52,6 @@ samba:
winbind enum groups: yes
winbind expand groups: 0
winbind use default domain: yes
winbind trusted domains only: no
winbind refresh tickets: no
winbind offline logon: no
winbind cache time: 10
Expand Down
2 changes: 1 addition & 1 deletion samba/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ include:
- samba.server
- samba.config
- samba.client
- samba.users
# samba.users
# samba.winbind
# samba.winbind-ad
2 changes: 1 addition & 1 deletion samba/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'service': 'smb',
},
'Debian': {
'client': 'samba-client',
'client': 'smbclient',
'service': salt['grains.filter_by']({
'lenny': 'samba',
'squeeze': 'samba',
Expand Down
12 changes: 6 additions & 6 deletions samba/users/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ include:
{% endif %}

{% for login,user in salt['pillar.get']('samba:users', {}).items() %}
samba_{{ login }}:
{{ login }}:
user.present:
- name: {{ login }}
- fullname: {{ login }}
- password: {{ user.password }}

samba_smbpasswd_{{ login }}:
cmd.run:
- name: "(echo '{{ user.password }}'; echo '{{ user.password }}') | smbpasswd -as {{ login }}"
- password: {{ user.password.passwd }}
pdbedit.managed:
- login: {{ login }}
- password: {{ user.password.nt }}
- password_hashed: True
{% endfor %}

0 comments on commit 74a0699

Please sign in to comment.