Files
fedora-infra_ansible/roles/nfs/server/tasks/main.yml
Ryan Lerch 25391e95b7 ansiblelint fixes - fqcn[action-core] - package to ansible.builtin.package
Replaces many references to  package: with ansible.builtin.package

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:28:00 +10:00

49 lines
1.1 KiB
YAML

#
# Install needed packages
#
---
- name: Install needed nfs server packages
ansible.builtin.package: name={{ item }} state=present
with_items:
- nfs-utils
- rpcbind
tags:
- nfs/server
- name: Setup /etc/exports
ansible.builtin.copy: src={{ inventory_hostname }}-exports dest=/etc/exports
register: exports
tags:
- nfs/server
- name: Enable nfs-related services and run them (fedora)
service: name={{ item }} enabled=true state=started
with_items:
- rpc-statd
when: ansible_distribution == 'Fedora'
tags:
- nfs/server
- name: Enable nfs-related services and run them (rhel)
service: name={{ item }} enabled=true state=started
with_items:
- rpcbind
- nfs-server
when: ansible_distribution == 'RedHat'
tags:
- nfs/server
- name: Enable nfs-related services and run them (rhel) 7/8
service: name={{ item }} enabled=true state=started
with_items:
- nfs-lock
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 9
tags:
- nfs/server
- name: Kick exportfs if /etc/exports changed
ansible.builtin.command: /usr/sbin/exportfs -ra
when: exports.changed
tags:
- nfs/server