|
|
|
|
|
|
|
|
{% set used_sudo = [] %} |
|
|
{% set used_sudo = [] %} |
|
|
{% set used_googleauth = [] %} |
|
|
{% set used_googleauth = [] %} |
|
|
|
|
|
|
|
|
{%- for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %} |
|
|
|
|
|
|
|
|
{%- for name, user in pillar.get('users', {}).iteritems() if user.absent is not defined or not user.absent %} |
|
|
{%- if user == None -%} |
|
|
{%- if user == None -%} |
|
|
{%- set user = {} -%} |
|
|
{%- set user = {} -%} |
|
|
{%- endif -%} |
|
|
{%- endif -%} |
|
|
|
|
|
|
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
{% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %} |
|
|
|
|
|
|
|
|
{% for name, user in pillar.get('users', {}).iteritems() if user.absent is not defined or not user.absent %} |
|
|
{%- if user == None -%} |
|
|
{%- if user == None -%} |
|
|
{%- set user = {} -%} |
|
|
{%- set user = {} -%} |
|
|
{%- endif -%} |
|
|
{%- endif -%} |
|
|
|
|
|
|
|
|
- group: {{ user_group }} |
|
|
- group: {{ user_group }} |
|
|
- mode: {{ user.get('user_dir_mode', '0750') }} |
|
|
- mode: {{ user.get('user_dir_mode', '0750') }} |
|
|
- require: |
|
|
- require: |
|
|
- user: {{ name }} |
|
|
|
|
|
|
|
|
- user: {{ name }}_user |
|
|
- group: {{ user_group }} |
|
|
- group: {{ user_group }} |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
group.present: |
|
|
group.present: |
|
|
|
|
|
|
|
|
- group: {{ group }} |
|
|
- group: {{ group }} |
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
|
|
|
{% if 'ssh_keys' in user or 'ssh_auth' in user or 'ssh_auth.absent' in user %} |
|
|
user_keydir_{{ name }}: |
|
|
user_keydir_{{ name }}: |
|
|
file.directory: |
|
|
file.directory: |
|
|
- name: {{ user.get('home', '/home/{0}'.format(name)) }}/.ssh |
|
|
- name: {{ user.get('home', '/home/{0}'.format(name)) }}/.ssh |
|
|
|
|
|
|
|
|
{%- for group in user.get('groups', []) %} |
|
|
{%- for group in user.get('groups', []) %} |
|
|
- group: {{ group }} |
|
|
- group: {{ group }} |
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% if 'ssh_keys' in user %} |
|
|
{% if 'ssh_keys' in user %} |
|
|
{% set key_type = 'id_' + user.get('ssh_key_type', 'rsa') %} |
|
|
{% set key_type = 'id_' + user.get('ssh_key_type', 'rsa') %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% for name, user in pillar.get('users', {}).items() if user.absent is defined and user.absent %} |
|
|
|
|
|
|
|
|
{% for name, user in pillar.get('users', {}).iteritems() if user.absent is defined and user.absent %} |
|
|
{{ name }}: |
|
|
{{ name }}: |
|
|
{% if 'purge' in user or 'force' in user %} |
|
|
{% if 'purge' in user or 'force' in user %} |
|
|
user.absent: |
|
|
user.absent: |