Last active
January 11, 2020 22:54
-
-
Save ryan-lane/a6d1786bf54b32541ab2 to your computer and use it in GitHub Desktop.
user state example
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: | |
testuser: | |
full_name: Test User | |
id: 1001 | |
disabled: False |
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
Ensure human user testuser exist: | |
user.present: | |
- name: testuser | |
- uid: 1001 | |
- gid_from_name: True | |
- shell: /bin/bash | |
- createhome: True | |
- password: '*' | |
- fullname: Test User |
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
{% for name, user in pillar['users'].items() %} | |
Ensure human user {{ name }} exist: | |
user.present: | |
- name: {{ name }} | |
- uid: {{ user.id }} | |
- gid_from_name: True | |
- shell: /bin/bash | |
- createhome: True | |
- password: '*' | |
- fullname: {{ user.full_name }} | |
{% if 'disabled' in user and user.disabled %} | |
- expire: 1 | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment