-
-
Save txomon/cb0351692cc4406281b1 to your computer and use it in GitHub Desktop.
saltstack repo
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
machines: | |
theoden: | |
owner: javier | |
guest: True | |
aragorn: | |
owner: javier | |
de: False | |
frodo: | |
owner: javier | |
laptop: True |
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
base: | |
'*': | |
- machines | |
- users |
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: | |
javier: | |
id: 1000 | |
fullname: Javier Domingo Cansino | |
sudo: True | |
shell: /usr/bin/zsh | |
userone: | |
id: 1001 | |
fullname: User One | |
usertwo: | |
id: 1002 | |
fullname: User Two | |
userthree: | |
id: 1003 | |
fullname: User Three | |
guest: | |
id: 2000 | |
fullname: Invitado |
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
base: | |
'*': | |
- users |
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
{% set machine = pillar.machines.get(grains.nodename, {}) %} | |
{% if machine %} | |
{% for usr,attrs in pillar.users.iteritems() %} | |
{{usr}}: | |
user: | |
{% if attrs.get('absent',False) %} | |
- absent | |
{% elif usr=='guest' and not machine.get('guest',False) %} | |
- absent | |
{% else %} | |
- present | |
- fullname: {{ attrs.get('fullname', None) }} | |
- shell: {{ attrs.get('shell', '/bin/bash') }} | |
- home: /home/{{ usr }} | |
- uid: {{ attrs.id }} | |
- gid: {{ attrs.id }} | |
- gid_from_name: True | |
- create_home: True | |
- groups: | |
{% if attrs.get('sudo',False) %} | |
- wheel | |
{% endif %} | |
- tty | |
- uucp | |
- users | |
- optional_groups: | |
- adbusers | |
- avahi | |
- locate | |
{% if machine.get('laptop',False) %} | |
- rfkill | |
{% endif %} | |
{% if machine.get('de',True) %} | |
- games | |
- gdm | |
- networkmanager | |
- vboxusers | |
- wireshark | |
{% endif %} | |
{% endif %} | |
{% endfor %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment