-
  name: "Block to Allow Loading of Variables without running task"
  when: run_tasks
  block:
    -
      name: Include OS-specific variables.
      ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
    
    -
      name: Include overrides specific to Fedora.
      ansible.builtin.include_vars: Fedora.yml
      when:
        - ansible_os_family == 'RedHat'
        - ansible_distribution == "Fedora"
    
    # Setup/install tasks.
    -
      name: Setup/install tasks setup-RedHat.yml
      ansible.builtin.include_tasks: setup-RedHat.yml
      when: ansible_os_family == 'RedHat'
    
    -
      name: Setup/install tasks setup-Debian.yml
      ansible.builtin.include_tasks: setup-Debian.yml
      when: ansible_os_family == 'Debian'
    
    -
      name: Ensure directories to export exist
      ansible.builtin.file: # noqa 208
        path: "{{ item.strip().split()[0] }}"
        state: directory
      with_items: "{{ nfs_exports }}"
    
    -
      name: Copy exports file.
      ansible.builtin.template:
        src: exports.j2
        dest: /etc/exports
        owner: root
        group: root
        mode: "0644"
      notify: Reload nfs
    
    -
      name: Ensure nfs is running.
      ansible.builtin.service:
        name: "{{ nfs_server_daemon }}"
        state: "started"
        enabled: "yes"
      when: nfs_exports | length
