n
Size: a a a
KN
salt -l debug 'host' state.apply users на pastbin выложи и сюда ссылку дайKN
base:
'*':
- users.vpupkin
- users.bpupkin
- users.cpupkinusers.vpupkin с вырезанием всей приватной инфыKN
{% for user, args in pillar.get('users', {}).items() %}
{{ user }}:
{% if args.status == 'present' %}
group.present:
- gid: {{ args.uid }}
user.present:
- fullname: {{ args.fullname }}
- uid: {{ args.uid }}
- gid: {{ args.uid }}
{% if 'shell' in args %}
- shell: {{ args.shell }}
{% endif %}
{% if 'home' in args %}
- home: {{ args.home }}
{% endif %}
{% if 'groups' in args %}
- groups: {{ args.groups }}
{% endif %}
{% if 'ssh_keys' in args %}
ssh_auth.present:
- user: {{ user }}
- names:
{% for key in args.ssh_keys %}
- {{ key }}
{% endfor %}
{% endif %}
{% endif %} # if status=present
## Remove User if absent
{% if args.status == 'absent' %}
user.absent: []
group.absent: []MT
{% if 'shell' in args %}
- shell: {{ args.shell }}
{% endif %} - shell: {{ args.get('shell', 'дефолтное_значение') }} - shell: {{ args.shell | default ('дефолтное_значение', true) }}GG
{% if 'shell' in args %}
- shell: {{ args.shell }}
{% endif %} - shell: {{ args.get('shell', 'дефолтное_значение') }} - shell: {{ args.shell | default ('дефолтное_значение', true) }}default('значение', true) мне сейчас очень подгадилоGG
KP
- shell: {{ args.get('shell', 'дефолтное_значение') }}MT
n
KP