<commit_before>---

- name: Configure blacklist
  ini_file:
    path: /opt/dnscrypt-proxy2/linux-x86_64/dnscrypt-proxy.toml
    section: blacklist
    option: blacklist_file
    value: "'{{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}'"
    mode: '0644'
    backup: yes

- name: Configure blacklist logging
  ini_file:
    path: /opt/dnscrypt-proxy2/linux-x86_64/dnscrypt-proxy.toml
    section: blacklist
    option: log_file
    value: "'{{ dnscrypt_proxy_blacklist_logpath | default(omit) }}'"
    mode: '0644'
    backup: yes

- name: Ensure blacklist cache directory exists
  file:
    dest: "{{ dnscrypt_proxy_blacklist_path }}"
    state: directory
    mode: '0755'
    owner: nobody

- name: Debian | ensure cron is installed
  apt: name=cron state=present
  when: ansible_os_family == 'Debian'
  register: pkg_result
  until: pkg_result is success

- name: RedHat | ensure cron is installed
  yum: name=crontabs state=present
  when: ansible_os_family == "RedHat"
  register: pkg_result
  until: pkg_result is success

- name: Ensure curl package is present for cron
  package:
    name: curl
    state: present

- name: Ensure schedule task to retrieve blacklist
  cron:
    name: dnscrypt blacklist update
    minute: '0'
    hour: '2'
    user: nobody
    job: >
      curl -O {{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}
        {{ dnscrypt_proxy_blacklist }}
    cron_file: ansible_dnscrypt-proxy2_blacklist

- name: Check if blacklist file
  stat:
    path: "{{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}"
  register: blacklistf

- name: Ensure initial blacklist exists
  get_url:
    url: "{{ dnscrypt_proxy_blacklist }}"
    dest: "{{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}"<commit_msg>cron job must be one-line<commit_after>---

- name: Configure blacklist
  ini_file:
    path: /opt/dnscrypt-proxy2/linux-x86_64/dnscrypt-proxy.toml
    section: blacklist
    option: blacklist_file
    value: "'{{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}'"
    mode: '0644'
    backup: yes

- name: Configure blacklist logging
  ini_file:
    path: /opt/dnscrypt-proxy2/linux-x86_64/dnscrypt-proxy.toml
    section: blacklist
    option: log_file
    value: "'{{ dnscrypt_proxy_blacklist_logpath | default(omit) }}'"
    mode: '0644'
    backup: yes

- name: Ensure blacklist cache directory exists
  file:
    dest: "{{ dnscrypt_proxy_blacklist_path }}"
    state: directory
    mode: '0755'
    owner: nobody

- name: Debian | ensure cron is installed
  apt: name=cron state=present
  when: ansible_os_family == 'Debian'
  register: pkg_result
  until: pkg_result is success

- name: RedHat | ensure cron is installed
  yum: name=crontabs state=present
  when: ansible_os_family == "RedHat"
  register: pkg_result
  until: pkg_result is success

- name: Ensure curl package is present for cron
  package:
    name: curl
    state: present

- name: Ensure schedule task to retrieve blacklist
  cron:
    name: dnscrypt blacklist update
    minute: '0'
    hour: '2'
    user: nobody
    job: >
      curl -O {{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }} {{ dnscrypt_proxy_blacklist }}
    cron_file: ansible_dnscrypt-proxy2_blacklist

- name: Check if blacklist file
  stat:
    path: "{{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}"
  register: blacklistf

- name: Ensure initial blacklist exists
  get_url:
    url: "{{ dnscrypt_proxy_blacklist }}"
    dest: "{{ dnscrypt_proxy_blacklist_path }}/{{ dnscrypt_proxy_blacklist | basename }}"
{'fraction_non_alphanumeric': 0.10103485838779956, 'fraction_numerical': 0.013616557734204794, 'mean_word_length': 3.7577720207253886, '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': '1036109', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1289, 'n_words': 308}