New in version 2018.3.0.
To ensure an NFS export exists:
add_simple_export: nfs_export.present: - name: '/srv/nfs' - hosts: '10.0.2.0/24' - options: - 'rw'
This creates the following in /etc/exports:
/srv/nfs 10.0.2.0/24(rw)
For more complex exports with multiple groups of hosts, use 'clients':
add_complex_export: nfs_export.present: - name: '/srv/nfs' - clients: # First export, same as simple one above - hosts: '10.0.2.0/24' options: - 'rw' # Second export - hosts: '*.example.com' options: - 'ro' - 'subtree_check'
This creates the following in /etc/exports:
/srv/nfs 10.0.2.0/24(rw) 192.168.0.0/24,172.19.0.0/16(ro,subtree_check)
Any export of the given path will be modified to match the one specified.
To ensure an NFS export is absent:
delete_export: nfs_export.absent: - name: '/srv/nfs'
Ensure that the named path is not exported
Ensure that the named export is present with the given options
- clients: # First export - hosts: '10.0.2.0/24' options: - 'rw' # Second export - hosts: '*.example.com' options: - 'ro' - 'subtree_check'
hosts: '10.0.2.123' hosts: '10.0.2.0/24' hosts: 'minion1.example.com' hosts: '*.example.com' hosts: '*'
options: - 'rw' - 'subtree_check'
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.nfs_export.html