<commit_before>{% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %}
{%- if user == None -%}
{%- set user = {} -%}
{%- endif -%}
{%- set user_files = salt['pillar.get'](('users:'~ name ~ ':user_files}, {'enabled': false}) -%}
{%- set home = user.get('home',"/home/%s" %name) -%}
{% endfor %}
<commit_msg>adding new logging, ruby and ssh init.sls according to the tutorial<commit_after>{% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %}
{%- if user == None -%}
{%- set user = {} -%}
{%- endif -%}
{%- set user_files = salt['pillar.get'](('users:'~ name ~ ':user_files}, {'enabled': false}) -%}
{%- set home = user.get('home',"/home/%s" %name) -%}
{%- set user_group = name -%}

{% for group in user.get('groups',[] %}
users_{{name}}_{{group}}_group:
  group:
    - name: {{group}}
    - present
{% endfor %}

users_{{name}}_user:
  group.present:
    - name: {{user_group}}
    - gid: {{ user['uid']}}
  user.present:
    - name: {{ name }}
    - home: {{ home }}
    - shell: {{ user.get('shell') }}
    - uid: {{user['uid'] }}
    - password: '{{user['password'] }}'
    - fullname: {{user['fullname'] }}
    - groups:
      - {{user['user_group'] }}
      {% for group in user.get('groups', [] %}
      - {{ group }}
      {% endfor %}

{% if 'ssh_auth' in user %}
{% for auth in user['ssh_auth'] %}
users_ssh_auth_{{name}}_{{loop.index0 }}:
  ssh_auth.present:
    - user: {{ name }}
    - name: {{ auth}}
{% endfor%}
{% endif %}

{% if user_files.enabled %}
vimrc_{{name}}:
  file.managed:
    - name: {{home}}/.vimrc
    - source: salt:://users/files.vimrc

oh_my_zsh_{{name}}:
  git.latest:
    - name: git://github.com/robbyrussell/oh-my-zsh.git
    - target: {{home}}/.oh-my-zsh
    - require:
      - user: {{name}}  

oh_my_zsh_theme{{name}}:
  file.managed:
    - name: {{home}}/.oh-my-zsh/themes/xxf.zsh-theme
    - source: salt:://users/files/.xxf.zsh-themes
    - require:
      - user: {{name}}
{% endif %}

{% endfor %}

{'fraction_non_alphanumeric': 0.24399804017638413, 'fraction_numerical': 0.0004899559039686428, 'mean_word_length': 2.972762645914397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7418981', 'n_tokens_mistral': 822, 'n_tokens_neox': 759, 'n_words': 159}