<commit_before>---
- hosts: controller
  vars:
    metadata:
      name: Check controller ulimits
      description: >
        This will check the ulimits of each controller.
      groups:
      - post-deployment
    nofiles_default: 1025
    nproc_default: 1025
  tasks:
  - name: Get nofiles limit
    become: true
    command: sh -c "ulimit -n"
    register: nofilesval
    changed_when: False
  - name: Check nofiles limit
    fail:
      msg: >
        nofiles is set to {{ nofilesval.stdout }}.  It should be at least 2048 or higher, depending on available resources.
    failed_when: "{{ nofilesval.stdout|int }} < {{ nofiles_default }}"
    #ignore_errors: True

  - name: Get nproc limit
    become: true
    command: sh -c "ulimit -u"
    register: nprocval
    changed_when: False
  - name: Check nproc limit
    fail:
      msg: >
        nproc is set to {{ nprocval.stdout }}.  It should be at least 2048 or higher, depending on available resources.
    failed_when: "{{ nprocval.stdout|int }} < {{ nproc_default }}"
<commit_msg>Updated nofiles_min to check against that value<commit_after>---
- hosts: controller
  vars:
    metadata:
      name: Check controller ulimits
      description: >
        This will check the ulimits of each controller.
      groups:
      - post-deployment
    nofiles_min: 2048
    nproc_min: 2048
  tasks:
  - name: Get nofiles limit
    become: true
    command: sh -c "ulimit -n"
    register: nofilesval
    changed_when: False
  - name: Check nofiles limit
    fail:
      msg: >
        nofiles is set to {{ nofilesval.stdout }}.  It should be at least 2048 or higher, depending on available resources.
    failed_when: "{{ nofilesval.stdout|int }} < {{ nofiles_min }}"
    #ignore_errors: True

  - name: Get nproc limit
    become: true
    command: sh -c "ulimit -u"
    register: nprocval
    changed_when: False
  - name: Check nproc limit
    fail:
      msg: >
        nproc is set to {{ nprocval.stdout }}.  It should be at least 2048 or higher, depending on available resources.
    failed_when: "{{ nprocval.stdout|int }} < {{ nproc_min }}"

{'fraction_non_alphanumeric': 0.09134157944814462, 'fraction_numerical': 0.015223596574690771, 'mean_word_length': 2.534453781512605, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '369311', 'n_tokens_mistral': 670, 'n_tokens_neox': 651, 'n_words': 224}