<commit_before>---

- name: Create swapfile {{freebsd_postinstall_swap_file}}
  shell: sh -c 'if [ ! -e {{freebsd_postinstall_swap_file}} ]; then printf "create"; fi'
  register: command_result
  changed_when: command_result.stdout == "create"
  notify: create and mount swap
  tags: create_mount_swap_file

- name: Change swapfile {{freebsd_postinstall_swap_file}}
  shell: sh -c 'if [ -e {{freebsd_postinstall_swap_file}} ] && [ "`stat -f %z {{freebsd_postinstall_swap_file}}`" -ne "{{freebsd_postinstall_swap_stsize}}" ]; then printf "change"; fi'
  register: command_result
  changed_when: command_result.stdout == "change"
  notify: change and mount swap
  tags: change_mount_swap_file
  
- name: Create swap entry in /etc/fstab
  lineinfile: >
    dest="/etc/fstab"
    regexp="{{freebsd_postinstall_swap_file}}"
    line="{{freebsd_postinstall_swap_md}} none swap sw,file={{freebsd_postinstall_swap_file}},late 0 0"
    backup="yes"
  notify: create and mount swap
  tags: mount_swap_file
<commit_msg>Swap is not installed by default. freebsd_postinstall_swap added.<commit_after>---

- name: Create swapfile {{freebsd_postinstall_swap_file}}
  shell: sh -c 'if [ ! -e {{freebsd_postinstall_swap_file}} ]; then printf "create"; fi'
  register: command_result
  changed_when: command_result.stdout == "create"
  notify: create and mount swap
  when: freebsd_postinstall_swap == "yes"
  tags: create_mount_swap_file

- name: Change swapfile {{freebsd_postinstall_swap_file}}
  shell: sh -c 'if [ -e {{freebsd_postinstall_swap_file}} ] && [ "`stat -f %z {{freebsd_postinstall_swap_file}}`" -ne "{{freebsd_postinstall_swap_stsize}}" ]; then printf "change"; fi'
  register: command_result
  changed_when: command_result.stdout == "change"
  notify: change and mount swap
  when: freebsd_postinstall_swap == "yes"
  tags: change_mount_swap_file
  
- name: Create swap entry in /etc/fstab
  lineinfile: >
    dest="/etc/fstab"
    regexp="{{freebsd_postinstall_swap_file}}"
    line="{{freebsd_postinstall_swap_md}} none swap sw,file={{freebsd_postinstall_swap_file}},late 0 0"
    backup="yes"
  notify: create and mount swap
  when: freebsd_postinstall_swap == "yes"
  tags: mount_swap_file

- name: Remove swap entry from /etc/fstab
  lineinfile: >
    dest="/etc/fstab"
    regexp="{{freebsd_postinstall_swap_file}}"
    line="{{freebsd_postinstall_swap_md}} none swap sw,file={{freebsd_postinstall_swap_file}},late 0 0"
    backup="yes"
    state="absent"
# notify: umount swap
  when: freebsd_postinstall_swap == "no"
  tags: mount_swap_file

{'fraction_non_alphanumeric': 0.12279325225578658, 'fraction_numerical': 0.0023538642604943117, 'mean_word_length': 5.204379562043796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '6113569', 'n_tokens_mistral': 895, 'n_tokens_neox': 857, 'n_words': 205}