<commit_before>---
# https://www.freebsd.org/doc/handbook/network-nfs.html

- name: Enable and start nfs server
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^nfs_server_enable", line: "nfs_server_enable=\"YES\""}
    - { regexp: "^rpcbind_enable", line: "rpcbind_enable=\"YES\""}
    - { regexp: "^mountd_flags", line: "mountd_flags=\"{{ freebsd_postinstall_mountd_flags }}\""}
  when: freebsd_postinstall_nfsd_service_enable == "YES"
  notify: enable and start nfs server

- name: Disable and stop nfs server
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^nfs_server_enable", line: "nfs_server_enable=\"NO\""}
  when: freebsd_postinstall_nfsd_service_enable == "NO"
  notify: disable and stop nfs server

- name: Enable and start lockd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_lockd_enable", line: "rpc_lockd_enable=\"YES\""}
  when: freebsd_postinstall_rpc_lockd_enable == "YES"
  notify: enable and start lockd
  
- name: Disable and stop lockd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_lockd_enable", line: "rpc_lockd_enable=\"NO\""}
  when: freebsd_postinstall_rpc_lockd_enable == "NO"
  notify: disable and stop lockd
  
- name: Enable and start statd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_statd_enable", line: "rpc_statd_enable=\"YES\""}
  when: freebsd_postinstall_rpc_statd_enable == "YES"
  notify: enable and start statd
  
- name: Disable and stop statd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_statd_enable", line: "rpc_statd_enable=\"NO\""}
  when: freebsd_postinstall_rpc_statd_enable == "NO"
  notify: disable and stop statd
  
- name: Disable and stop rpcbind
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpcbind_enable", line: "rpcbind_enable=\"NO\""}
  when: freebsd_postinstall_rpcbind_enable == "NO"
  notify: disable and stop rpcbind
  
- name: Configure /etc/exports
  template: >
    src="exports.j2"
    dest="/etc/exports"<commit_msg>Formatting of nfsd.<commit_after>---
# https://www.freebsd.org/doc/handbook/network-nfs.html

- name: Enable and start nfs server
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^nfs_server_enable", line: "nfs_server_enable=\"YES\""}
    - { regexp: "^rpcbind_enable", line: "rpcbind_enable=\"YES\""}
    - { regexp: "^mountd_flags", line: "mountd_flags=\"{{ freebsd_postinstall_mountd_flags }}\""}
  when: freebsd_postinstall_nfsd_service_enable|lower == "yes"
  notify: enable and start nfs server

- name: Disable and stop nfs server
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^nfs_server_enable", line: "nfs_server_enable=\"NO\""}
  when: freebsd_postinstall_nfsd_service_enable|lower == "no"
  notify: disable and stop nfs server

- name: Enable and start lockd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_lockd_enable", line: "rpc_lockd_enable=\"YES\""}
  when: freebsd_postinstall_rpc_lockd_enable|lower == "yes"
  notify: enable and start lockd
  
- name: Disable and stop lockd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_lockd_enable", line: "rpc_lockd_enable=\"NO\""}
  when: freebsd_postinstall_rpc_lockd_enable|lower == "no"
  notify: disable and stop lockd
  
- name: Enable and start statd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_statd_enable", line: "rpc_statd_enable=\"YES\""}
  when: freebsd_postinstall_rpc_statd_enable|lower == "yes"
  notify: enable and start statd
  
- name: Disable and stop statd
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpc_statd_enable", line: "rpc_statd_enable=\"NO\""}
  when: freebsd_postinstall_rpc_statd_enable|lower == "no"
  notify: disable and stop statd
  
- name: Disable and stop rpcbind
  lineinfile: dest="/etc/rc.conf" regexp="{{ item.regexp }}" line="{{ item.line }}" backup="yes"
  with_items:
    - { regexp: "^rpcbind_enable", line: "rpcbind_enable=\"NO\""}
  when: freebsd_postinstall_rpcbind_enable|lower == "no"
  notify: disable and stop rpcbind
  
- name: Configure /etc/exports
  template: >
    src="exports.j2"
    dest="/etc/exports"
{'fraction_non_alphanumeric': 0.1713943268078306, 'fraction_numerical': 0.00039952057530962844, 'mean_word_length': 4.51431718061674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2810942', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1787, 'n_words': 393}