File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/nfs_export.cpython-310.pyc
Back
o ;j� � @ s, d Z ddlZdd� Zd dd�Zddd �ZdS )a� Management of NFS exports =============================================== .. versionadded:: 2018.3.0 To ensure an NFS export exists: .. code-block:: yaml add_simple_export: nfs_export.present: - name: '/srv/nfs' - hosts: '10.0.2.0/24' - options: - 'rw' This creates the following in /etc/exports: .. code-block:: bash /srv/nfs 10.0.2.0/24(rw) For more complex exports with multiple groups of hosts, use 'clients': .. code-block:: yaml 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: .. code-block:: bash /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: .. code-block:: yaml delete_export: nfs_export.absent: - name: '/srv/nfs' � Nc C s d} t jj�| �r t| �S dS )z, Only work with nfs tools installed Zexportfs)FzSThe nfs_exports state module failed to load: the exportfs binary is not in the path)�salt�utils�path�which�bool)�cmd� r �J/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/nfs_export.py�__virtual__? s r �/etc/exportsc C s\ | }| i ddd�}|s|sd|d<