diff --git a/roles/nfs/server/tasks/main.yml b/roles/nfs/server/tasks/main.yml index 717994d8b3..2c2433c86f 100644 --- a/roles/nfs/server/tasks/main.yml +++ b/roles/nfs/server/tasks/main.yml @@ -28,11 +28,18 @@ with_items: - rpcbind - nfs-server - - nfs-lock 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 command: /usr/sbin/exportfs -ra when: exports.changed