<commit_before>{%- from 'telemetry/settings.sls' import telemetry with context %}
{%- from 'filecollector/settings.sls' import filecollector with context %}
{%- from 'fluent/settings.sls' import fluent with context %}

install_fluent_logger:
  cmd.run:
    - name: pip install fluent-logger>=0.9.6 --ignore-installed
    - unless: pip list --no-index | grep -E 'fluent-logger'

install_yaml:
  cmd.run:
    - name: pip install PyYAML --ignore-installed
    - unless: pip list --no-index | grep -E 'PyYAML'

install_pid:
  cmd.run:
    - name: pip install pid --ignore-installed
    - unless: pip list --no-index | grep -E 'pid'

/opt/filecollector:
  file.directory:
    - name: /opt/filecollector
    - user: "root"
    - group: "root"
    - mode: 740
    - recurse:
      - user
      - group
      - mode

/var/lib/filecollector:
  file.directory:
    - name: /var/lib/filecollector
    - user: "root"
    - group: "root"
    - mode: 740

/opt/filecollector/filecollector.py:
   file.managed:
    - source: salt://filecollector/scripts/filecollector.py
    - user: "root"
    - group: "root"
    - mode: '0750'

/opt/filecollector/filecollector-collect.yaml:
   file.managed:
    - source: salt://filecollector/template/filecollector.yaml.j2
    - template: jinja
    - user: "root"
    - group: "root"
    - mode: '0640'
    - context:
        destination: "LOCAL"

{% if fluent.dbusClusterLogsCollection %}
/opt/filecollector/filecollector-eng.yaml:
   file.managed:
    - source: salt://filecollector/template/filecollector.yaml.j2
    - template: jinja
    - user: "root"
    - group: "root"
    - mode: '0640'
    - context:<commit_msg>CB-7397. Fix folder permissions for filecollector<commit_after>{%- from 'telemetry/settings.sls' import telemetry with context %}
{%- from 'filecollector/settings.sls' import filecollector with context %}
{%- from 'fluent/settings.sls' import fluent with context %}

install_fluent_logger:
  cmd.run:
    - name: pip install fluent-logger>=0.9.6 --ignore-installed
    - unless: pip list --no-index | grep -E 'fluent-logger'

install_yaml:
  cmd.run:
    - name: pip install PyYAML --ignore-installed
    - unless: pip list --no-index | grep -E 'PyYAML'

install_pid:
  cmd.run:
    - name: pip install pid --ignore-installed
    - unless: pip list --no-index | grep -E 'pid'

/opt/filecollector:
  file.directory:
    - name: /opt/filecollector
    - user: "root"
    - group: "root"
    - mode: 750

/var/lib/filecollector:
  file.directory:
    - name: /var/lib/filecollector
    - user: "root"
    - group: "root"
    - mode: 750

/opt/filecollector/filecollector.py:
   file.managed:
    - source: salt://filecollector/scripts/filecollector.py
    - user: "root"
    - group: "root"
    - mode: '0750'

/opt/filecollector/filecollector-collect.yaml:
   file.managed:
    - source: salt://filecollector/template/filecollector.yaml.j2
    - template: jinja
    - user: "root"
    - group: "root"
    - mode: '0640'
    - context:
        destination: "LOCAL"

{% if fluent.dbusClusterLogsCollection %}
/opt/filecollector/filecollector-eng.yaml:
   file.managed:
    - source: salt://filecollector/template/filecollector.yaml.j2
    - template: jinja
    - user: "root"
    - group: "root"
    - mode: '0640'
    - context:
{'fraction_non_alphanumeric': 0.14163352707249924, 'fraction_numerical': 0.015295197308045273, 'mean_word_length': 2.6333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '832320', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1145, 'n_words': 250}