<commit_before>- name: Include OS-specific variables
  include_vars: "{{ item }}"
  with_first_found:
    - "{{ ansible_facts.os_family | lower }}_{{ ansible_facts.distribution_major_version }}.yml"
    - "{{ ansible_facts.os_family | lower }}.yml"
  ignore_errors: true

- name: auth | Install auth pre-reqs (Debian)
  become: yes
  apt:
    name:
      - apache2-utils
      - "{{ passlib }}"
    state: present
  register: _task
  retries: 5
  delay: 3
  until: _task is succeeded
  when: ansible_facts.os_family == 'Debian'

- name: auth | Install auth pre-reqs (RedHat)
  become: yes
  yum:
    name:
      - httpd-tools
    state: present
  register: _task
  retries: 5
  delay: 3
  until: _task is succeeded
  when: ansible_facts.os_family == 'RedHat'

# Use pip to install passlib as no python38-passlib yum package available
- name: auth | Install pip pre-reqs (RedHat)
  become: yes
  pip:
     name: passlib
     state: present
  when: ansible_facts.os_family == 'RedHat'

- name: auth | Create htpasswd file
  become: true
  htpasswd:<commit_msg>Use python passlib on EL7 and pip on EL8<commit_after>- name: Include OS-specific variables
  include_vars: "{{ item }}"
  with_first_found:
    - "{{ ansible_facts.os_family | lower }}_{{ ansible_facts.distribution_major_version }}.yml"
    - "{{ ansible_facts.os_family | lower }}.yml"
  ignore_errors: true

- name: auth | Install auth pre-reqs (Debian)
  become: yes
  apt:
    name:
      - apache2-utils
      - "{{ passlib }}"
    state: present
  register: _task
  retries: 5
  delay: 3
  until: _task is succeeded
  when: ansible_facts.os_family == 'Debian'

- name: auth | Install auth pre-reqs (RedHat)
  become: yes
  yum:
    name: httpd-tools
    state: present
  register: _task
  retries: 5
  delay: 3
  until: _task is succeeded
  when: ansible_facts.os_family == 'RedHat'

# Use pip to install passlib as no python38-passlib yum package available
- name: auth | Install pip pre-reqs (RedHat)
  become: yes
  pip:
     name: passlib
     executable: /usr/bin/pip3
     state: present
  when: ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version!='7'

- name: auth | Install auth pre-reqs (RedHat)
  become: yes
  yum:
    name: httpd-tools
    state: present
  register: _task
  retries: 5
  delay: 3
  until: _task is succeeded
  when: ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version=='7'

- name: auth | Create htpasswd file
  become: true
  htpasswd:
{'fraction_non_alphanumeric': 0.10526315789473684, 'fraction_numerical': 0.008437123342707915, 'mean_word_length': 3.2710120068610635, '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': '2346496', 'n_tokens_mistral': 925, 'n_tokens_neox': 884, 'n_words': 249}