# SPDX-License-Identifier: MIT-0 --- - name: Install NFS server packages ansible.builtin.dnf: name: nfs-utils state: present - name: Create the Koji top directory to be exported ansible.builtin.file: path: "{{ koji_top_dir }}" state: directory owner: nobody group: nobody mode: "0755" - name: Add Koji nodes to /etc/hosts on NFS server ansible.builtin.lineinfile: path: /etc/hosts line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ item }}" state: present mode: "0644" loop: "{{ groups['all'] }}" - name: Configure the NFS export for all Koji nodes ansible.builtin.template: src: exports.j2 dest: /etc/exports owner: root group: root mode: "0644" # This command does not provide a reliable way to determine if the NFS exports were changed, # so we run it on every execution. - name: Export all NFS filesystems ansible.builtin.command: exportfs -ra changed_when: false - name: Start and enable NFS services ansible.builtin.service: name: "{{ item }}" state: started enabled: true loop: ["rpcbind", "nfs-server"] - name: Open firewall for NFS ansible.posix.firewalld: service: "{{ item }}" permanent: true state: enabled loop: ["nfs", "rpc-bind", "mountd"] notify: Reload firewalld