Created
December 27, 2016 17:51
-
-
Save evilbulgarian/95d880a1130af5a3b8ebcc5a66daaa1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users: | |
- name: emi | |
fullname: puppet | |
email: bbb@aaa | |
uid: 20000 | |
gid: 20000 | |
shell: /bin/bash | |
groups: | |
- www-data | |
- emi | |
shadow: '' | |
sshpriv: | | |
-----BEGIN RSA PRIVATE KEY----- | |
{% set users = salt.pillar.get(users,{}) %} | |
2 | |
3 {% for user in users %} | |
4 | |
5 user_{{user.name}}: | |
6 group.present: | |
7 - name: {{user.name}} | |
8 - gid: {{user.gid}} | |
9 | |
10 user.present: | |
11 - name: {{user.name}} | |
12 - fullname: {{user.fullname}} | |
13 - password: {{user.shadow}} | |
14 - shell: {{user.shell}} | |
15 - uid: {{user.uid}} | |
16 - gid: {{user.gid}} | |
17 {% if user.groups %} | |
18 - optional_groups: | |
19 {% for group in user.groups %} | |
20 - {{group}} | |
21 {% endfor %} | |
22 {% endif %} | |
23 - require: | |
24 - group: user_{{user.name}} | |
25 | |
26 file.directory: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment