<commit_before>{% macro sls_block(dict) %}
    {% for key, value in dict.items() %}
    - {{ key }}: {{ value|json() }}
    {% endfor %}
{% endmacro %}

{% set uwsgi = salt['pillar.get']('uwsgi', {
  'lookup': salt['grains.filter_by']({
    'Debian': {
      'server_pkg'              : 'uwsgi',
      'uwsgi_dir'               : '/etc/uwsgi',
      'uwsgi_service'           : 'uwsgi',
      'application_available'   : '/etc/uwsgi/apps-available',
      'application_enabled'     : '/etc/uwsgi/apps-enabled',
      'application_use_symlink' : True,
      'emperor_pkg'             : 'uwsgi-emperor',
      'emperor_service'         : 'uwsgi-emperor',
      'emperor_dir'             : '/etc/uwsgi-emperor',
      'vassal_available'        : '/etc/uwsgi-emperor/vassals',
      'vassal_enabled'          : '/etc/uwsgi-emperor/vassals',
      'vassal_use_symlink'      : False,
      'emperor_config'          : 'emperor.ini',
      'plugins'                 : ['uwsgi-plugin-python'],
    },
    'Arch': {
      'server_pkg'              : 'uwsgi',
      'uwsgi_dir'               : '/etc/uwsgi',
      'uwsgi_service'           : 'uwsgi@',
      'application_available'   : '/etc/uwsgi',
      'application_enabled'     : '/etc/uwsgi',
      'application_use_symlink' : False,
      'emperor_pkg'             : 'uwsgi',
      'emperor_service'         : 'emperor.uwsgi',
      'emperor_dir'             : '/etc/uwsgi',
      'vassal_available'        : '/etc/uwsgi/vassals',
      'vassal_enabled'          : '/etc/uwsgi/vassals',
      'vassal_use_symlink'      : False,
      'emperor_config'          : 'emperor.ini',
      'plugins'                 : ['uwsgi-plugin-python','uwsgi-plugin-python2'],
    },
    'RedHat': {
      'server_pkg'              : 'uwsgi',
      'uwsgi_service'           : 'uwsgi',
      'application_available'   : '/etc/uwsgi',
      'application_enabled'     : '/etc/uwsgi',
      'application_use_symlink' : False,
      'emperor_pkg'             : 'uwsgi',
      'emperor_service'         : 'uwsgi',
      'emperor_dir'             : '/etc',
      'vassal_available'        : '/etc/uwsgi.d',
      'vassal_enabled'          : '/etc/uwsgi.d',
      'vassal_use_symlink'      : False,
      'emperor_config'          : 'uwsgi.ini',
      'plugins'                 : ['uwsgi-plugin-python'],
    },

  }, default='Debian' ),

  'package': {
    'opts': {},
  },

  'service': {
    'enable': True,
    'opts': {},
  },

  'applications': {
    'disabled_postfix': '.disabled',
    'symlink_opts': {},
    'rename_opts': {},
    'managed_opts': {},
    'dir_opts': {
      'makedirs': True,
    },
    'managed': {},
  },

  'emperor': {
    'opts': {},
    'config': salt['grains.filter_by']({
      'Debian': {
        'autoload': 'true',
        'master': 'true',
        'workers': '2',
        'no-orphans': 'true',
        'log-date': 'true',
        'uid': 'www-data',
        'gid': 'www-data',
        'emperor': '/etc/uwsgi-emperor/vassals',
      },
      'RedHat': {
        'autoload': 'true',
        'master': 'true',
        'workers': '2',
        'no-orphans': 'true',
        'log-date': 'true',
        'uid': 'uwsgi',
        'gid': 'uwsgi',
        'emperor': '/etc/uwsgi.d',
      },
    }, default='Debian'),
  },

  'vassals': {
    'disabled_postfix': '.disabled',
    'symlink_opts': {},
    'rename_opts': {},
    'managed_opts': {},
    'dir_opts': {
      'makedirs': True,
    },
    'managed': {},
  },

}, merge=True) %}

{%- if salt['grains.get']('os_family') == 'RedHat' %}
  {%- if salt['grains.get']('osmajorrelease')|int < 7 %}<commit_msg>update archlinux emperor config<commit_after>{% macro sls_block(dict) %}
    {% for key, value in dict.items() %}
    - {{ key }}: {{ value|json() }}
    {% endfor %}
{% endmacro %}

{% set uwsgi = salt['pillar.get']('uwsgi', {
  'lookup': salt['grains.filter_by']({
    'Debian': {
      'server_pkg'              : 'uwsgi',
      'uwsgi_dir'               : '/etc/uwsgi',
      'uwsgi_service'           : 'uwsgi',
      'application_available'   : '/etc/uwsgi/apps-available',
      'application_enabled'     : '/etc/uwsgi/apps-enabled',
      'application_use_symlink' : True,
      'emperor_pkg'             : 'uwsgi-emperor',
      'emperor_service'         : 'uwsgi-emperor',
      'emperor_dir'             : '/etc/uwsgi-emperor',
      'vassal_available'        : '/etc/uwsgi-emperor/vassals',
      'vassal_enabled'          : '/etc/uwsgi-emperor/vassals',
      'vassal_use_symlink'      : False,
      'emperor_config'          : 'emperor.ini',
      'plugins'                 : ['uwsgi-plugin-python'],
    },
    'Arch': {
      'server_pkg'              : 'uwsgi',
      'uwsgi_dir'               : '/etc/uwsgi',
      'uwsgi_service'           : 'uwsgi@',
      'application_available'   : '/etc/uwsgi',
      'application_enabled'     : '/etc/uwsgi',
      'application_use_symlink' : False,
      'emperor_pkg'             : 'uwsgi',
      'emperor_service'         : 'emperor.uwsgi',
      'emperor_dir'             : '/etc/uwsgi',
      'vassal_available'        : '/etc/uwsgi/vassals',
      'vassal_enabled'          : '/etc/uwsgi/vassals',
      'vassal_use_symlink'      : False,
      'emperor_config'          : 'emperor.ini',
      'plugins'                 : ['uwsgi-plugin-python','uwsgi-plugin-python2'],
    },
    'RedHat': {
      'server_pkg'              : 'uwsgi',
      'uwsgi_service'           : 'uwsgi',
      'application_available'   : '/etc/uwsgi',
      'application_enabled'     : '/etc/uwsgi',
      'application_use_symlink' : False,
      'emperor_pkg'             : 'uwsgi',
      'emperor_service'         : 'uwsgi',
      'emperor_dir'             : '/etc',
      'vassal_available'        : '/etc/uwsgi.d',
      'vassal_enabled'          : '/etc/uwsgi.d',
      'vassal_use_symlink'      : False,
      'emperor_config'          : 'uwsgi.ini',
      'plugins'                 : ['uwsgi-plugin-python'],
    },

  }, default='Debian' ),

  'package': {
    'opts': {},
  },

  'service': {
    'enable': True,
    'opts': {},
  },

  'applications': {
    'disabled_postfix': '.disabled',
    'symlink_opts': {},
    'rename_opts': {},
    'managed_opts': {},
    'dir_opts': {
      'makedirs': True,
    },
    'managed': {},
  },

  'emperor': {
    'opts': {},
    'config': salt['grains.filter_by']({
      'Debian': {
        'autoload': 'true',
        'master': 'true',
        'workers': '2',
        'no-orphans': 'true',
        'log-date': 'true',
        'uid': 'www-data',
        'gid': 'www-data',
        'emperor': '/etc/uwsgi-emperor/vassals',
      },
      'RedHat': {
        'autoload': 'true',
        'master': 'true',
        'workers': '2',
        'no-orphans': 'true',
        'log-date': 'true',
        'uid': 'uwsgi',
        'gid': 'uwsgi',
        'emperor': '/etc/uwsgi.d',
      },
      'Arch': {
          'uid': 'http',
          'gid': 'http',
          'emperor': '/etc/uwsgi/vassals',
      },
    }, default='Debian'),
  },

  'vassals': {
    'disabled_postfix': '.disabled',
    'symlink_opts': {},
    'rename_opts': {},
    'managed_opts': {},
    'dir_opts': {
      'makedirs': True,
    },
    'managed': {},
  },

}, merge=True) %}

{%- if salt['grains.get']('os_family') == 'RedHat' %}
  {%- if salt['grains.get']('osmajorrelease')|int < 7 %}
{'fraction_non_alphanumeric': 0.19453507340946166, 'fraction_numerical': 0.001087547580206634, 'mean_word_length': 1.831793687451886, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6563516', 'n_tokens_mistral': 2708, 'n_tokens_neox': 2668, 'n_words': 360}