<commit_before>/usr/local/bin/freeipa_backup:
  file.managed:
    - source: salt://freeipa/scripts/freeipa_backup
    - user: root
    - group: root
    - mode: 750

{% if salt['pillar.get']('freeipa:backup:enabled') %}
/etc/freeipa_backup.conf:
  file.managed:
    - source: salt://freeipa/templates/freeipa_backup.conf.j2
    - template: jinja
    - user: root
    - group: root
    - mode: 640

{% if salt['pillar.get']('freeipa:backup:monthly_full_enabled') %}
/etc/cron.monthly/freeipa_backup_monthly:
  file.managed:
    - source: salt://freeipa/templates/freeipa_backup_monthly.j2
    - template: jinja
    - user: root
    - group: root
    - mode: 750
{% endif %}

{% if salt['pillar.get']('freeipa:backup:hourly_enabled') %}
/etc/cron.hourly/freeipa_backup_hourly:
  file.managed:
    - source: salt://freeipa/templates/freeipa_backup_hourly.j2
    - template: jinja
    - user: root
    - group: root
    - mode: 750
{% endif %}

{% if salt['pillar.get']('freeipa:backup:initial_full_enabled') %}
freeipa_initial_full_backup:
  cmd.run:
    - name: /usr/local/bin/freeipa_backup -t FULL -f "{{salt['grains.get']('fqdn')}}/full" && echo $(date +%Y-%m-%d:%H:%M:%S) >> /var/log/freeipa_initial_backup-executed
    - unless: test -f /var/log/freeipa_initial_backup-executed
    - require:
        - file: /usr/local/bin/freeipa_backup
        - file: /etc/freeipa_backup.conf
{% endif %}
{% endif %}
<commit_msg>CB-6879: Redundant full backup created on Azure FreeIPA HA hosts<commit_after>/usr/local/bin/freeipa_backup:
  file.managed:
    - source: salt://freeipa/scripts/freeipa_backup
    - user: root
    - group: root
    - mode: 750

{% if salt['pillar.get']('freeipa:backup:enabled') %}
/etc/freeipa_backup.conf:
  file.managed:
    - source: salt://freeipa/templates/freeipa_backup.conf.j2
    - template: jinja
    - user: root
    - group: root
    - mode: 640

{% if salt['pillar.get']('freeipa:backup:monthly_full_enabled') %}
freeipa_backoff_monthly_full:
  cmd.run:
    - name: /sbin/anacron -u cron.monthly
    - onlyif: test ! -s /var/spool/anacron/cron.monthly

/etc/cron.monthly/freeipa_backup_monthly:
  file.managed:
    - source: salt://freeipa/templates/freeipa_backup_monthly.j2
    - template: jinja
    - user: root
    - group: root
    - mode: 750
{% endif %}

{% if salt['pillar.get']('freeipa:backup:hourly_enabled') %}
/etc/cron.hourly/freeipa_backup_hourly:
  file.managed:
    - source: salt://freeipa/templates/freeipa_backup_hourly.j2
    - template: jinja
    - user: root
    - group: root
    - mode: 750
{% endif %}

{% if salt['pillar.get']('freeipa:backup:initial_full_enabled') %}
freeipa_initial_full_backup:
  cmd.run:
    - name: /usr/local/bin/freeipa_backup -t FULL -f "{{salt['grains.get']('fqdn')}}/full" && echo $(date +%Y-%m-%d:%H:%M:%S) >> /var/log/freeipa_initial_backup-executed
    - unless: test -f /var/log/freeipa_initial_backup-executed
    - require:
        - file: /usr/local/bin/freeipa_backup
        - file: /etc/freeipa_backup.conf
{% endif %}
{% endif %}

{'fraction_non_alphanumeric': 0.1637504126774513, 'fraction_numerical': 0.011224826675470452, 'mean_word_length': 3.2436974789915967, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2891797', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1170, 'n_words': 177}